Package net.serenitybdd.core.pages
Class WebElementFacadeImpl
java.lang.Object
net.serenitybdd.core.pages.WebElementFacadeImpl
- All Implemented Interfaces:
io.appium.java_client.FindsByAccessibilityId
,io.appium.java_client.FindsByAndroidUIAutomator
,io.appium.java_client.FindsByFluentSelector
,WebElementFacade
,WebElementState
,WebElementFacade
,WebElementState
,ConfigurableTimeouts
,org.openqa.selenium.interactions.Locatable
,org.openqa.selenium.SearchContext
,org.openqa.selenium.TakesScreenshot
,org.openqa.selenium.WebElement
,org.openqa.selenium.WrapsElement
- Direct Known Subclasses:
WebElementFacadeImpl
,WidgetObjectImpl
,WrappedWebElementFacadeImpl
public class WebElementFacadeImpl extends java.lang.Object implements WebElementFacade, WebElementFacade
A proxy class for a web element, providing some more methods.
-
Constructor Summary
Constructors Constructor Description WebElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, long implicitTimeoutInMilliseconds)
WebElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds)
WebElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, org.openqa.selenium.WebElement webElement, long implicitTimeoutInMilliseconds)
WebElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, org.openqa.selenium.WebElement webElement, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds)
WebElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, org.openqa.selenium.WebElement webElement, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds, org.openqa.selenium.By bySelector)
WebElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, org.openqa.selenium.WebElement webElement, org.openqa.selenium.WebElement resolvedELement, org.openqa.selenium.By bySelector, long timeoutInMilliseconds, long waitForTimeoutInMilliseconds)
WebElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement webElement, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds, org.openqa.selenium.By bySelector)
-
Method Summary
Modifier and Type Method Description WebElementFacade
and()
Convenience method to chain method calls more fluently.void
clear()
void
click()
Wait for an element to be visible and enabled, and then click on it.void
click(ClickStrategy clickStrategy)
Click on an element, with or without waiting for it to be visible and enabledboolean
containsElements(java.lang.String xpathOrCssSelector)
boolean
containsElements(org.openqa.selenium.By bySelector)
boolean
containsOnlyText(java.lang.String value)
Does this element exactly match given text?boolean
containsSelectOption(java.lang.String value)
Does this dropdown contain the specified value.boolean
containsText(java.lang.String value)
Does this element contain a given text?boolean
containsValue(java.lang.String value)
Does this element contain a given value attribute?FluentDropdownDeselect
deselect()
WebElementFacade
deselectAll()
Deprecated.WebElementFacade
deselectByIndex(int indexValue)
Deprecated.WebElementFacade
deselectByValue(java.lang.String value)
Deprecated.WebElementFacade
deselectByVisibleText(java.lang.String label)
Deprecated.protected boolean
driverIsDisabled()
WebElementState
expect(java.lang.String errorMessage)
protected WebElementState
expectingErrorMessage(java.lang.String errorMessage)
WebElementFacade
find(org.openqa.selenium.By bySelector)
<T extends WebElementFacade>
TfindBy(java.lang.String xpathOrCssSelector)
<T extends WebElementFacade>
TfindBy(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)
WebElementFacade
findBy(org.openqa.selenium.By selector)
org.openqa.selenium.WebElement
findElement(java.lang.String by, java.lang.String using)
org.openqa.selenium.WebElement
findElement(org.openqa.selenium.By by)
org.openqa.selenium.WebElement
findElementByAccessibilityId(java.lang.String id)
org.openqa.selenium.WebElement
findElementByAndroidUIAutomator(java.lang.String using)
java.util.List
findElements(java.lang.String by, java.lang.String using)
java.util.List<org.openqa.selenium.WebElement>
findElements(org.openqa.selenium.By by)
java.util.List<org.openqa.selenium.WebElement>
findElementsByAccessibilityId(java.lang.String id)
java.util.List<org.openqa.selenium.WebElement>
findElementsByAndroidUIAutomator(java.lang.String using)
WebElementFacade
foundBy(java.lang.String foundBy)
java.lang.String
getAttribute(java.lang.String name)
protected InternalSystemClock
getClock()
org.openqa.selenium.interactions.Coordinates
getCoordinates()
java.lang.String
getCssValue(java.lang.String propertyName)
java.time.Duration
getCurrentImplicitTimeout()
org.openqa.selenium.WebElement
getElement()
protected java.lang.String
getErrorMessage(java.lang.String defaultErrorMessage)
java.lang.String
getFirstSelectedOptionValue()
java.lang.String
getFirstSelectedOptionVisibleText()
java.lang.String
getFoundBy()
java.time.Duration
getImplicitTimeout()
long
getImplicitTimeoutInMilliseconds()
protected JavascriptExecutorFacade
getJavascriptExecutorFacade()
org.openqa.selenium.Point
getLocation()
org.openqa.selenium.support.pagefactory.ElementLocator
getLocator()
org.openqa.selenium.Rectangle
getRect()
<X> X
getScreenshotAs(org.openqa.selenium.OutputType<X> target)
java.lang.String
getSelectedValue()
java.util.List<java.lang.String>
getSelectedValues()
java.util.List<java.lang.String>
getSelectedVisibleTexts()
java.lang.String
getSelectedVisibleTextValue()
java.util.List<java.lang.String>
getSelectOptions()
org.openqa.selenium.Dimension
getSize()
java.lang.String
getTagName()
java.lang.String
getText()
java.lang.String
getTextContent()
java.lang.String
getTextValue()
java.lang.String
getValue()
org.openqa.selenium.WebElement
getWrappedElement()
boolean
hasClass(java.lang.String cssClassName)
boolean
hasFocus()
Does this element currently have the focus.boolean
isClickable()
Check to see if the element is clickableboolean
isCurrentlyEnabled()
boolean
isCurrentlyVisible()
Is this web element present and visible on the screen This method will not throw an exception if the element is not on the screen at all.boolean
isDisabled()
boolean
isDisplayed()
Is this element displayed or not? This method avoids the problem of having to parse an element's "style" attribute.boolean
isEnabled()
boolean
isPresent()
Returns true if an element is present on the screen, whether visible or not.boolean
isSelected()
boolean
isVisible()
Is this web element present and visible on the screen This method will not throw an exception if the element is not on the screen at all.protected void
notifyScreenChange()
java.time.Duration
resetTimeouts()
FluentDropdownSelect
select()
WebElementFacade
selectByIndex(int indexValue)
Deprecated.WebElementFacade
selectByValue(java.lang.String value)
Deprecated.WebElementFacade
selectByVisibleText(java.lang.String label)
Deprecated.void
sendKeys(java.lang.CharSequence... keysToSend)
void
setImplicitTimeout(java.time.Duration implicitTimeout)
void
setWindowFocus()
void
shouldBeCurrentlyVisible()
Checks whether a web element is visible.void
shouldBeEnabled()
void
shouldBePresent()
void
shouldBeVisible()
Checks whether a web element is visible.void
shouldContainElements(java.lang.String xpathOrCssSelector)
void
shouldContainElements(org.openqa.selenium.By bySelector)
void
shouldContainOnlyText(java.lang.String textValue)
Check that an element exactly matches a text valuevoid
shouldContainSelectedOption(java.lang.String textValue)
void
shouldContainText(java.lang.String textValue)
Check that an element contains a text valuevoid
shouldNotBeCurrentlyVisible()
Checks whether a web element is not visible straight away.void
shouldNotBeEnabled()
void
shouldNotBePresent()
void
shouldNotBeVisible()
Checks whether a web element is not visible.void
shouldNotContainText(java.lang.String textValue)
Check that an element does not contain a text valuevoid
submit()
WebElementFacade
then()
Convenience method to chain method calls more fluently.WebElementFacade
then(java.lang.String xpathOrCssSelector)
WebElementFacade
then(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)
WebElementFacade
then(org.openqa.selenium.By bySelector)
WebElementFacade
thenFind(java.lang.String xpathOrCssSelector)
WebElementFacade
thenFind(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)
ListOfWebElementFacades
thenFindAll(java.lang.String xpathOrCssSelector)
ListOfWebElementFacades
thenFindAll(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)
ListOfWebElementFacades
thenFindAll(org.openqa.selenium.By selector)
long
timeoutInMilliseconds()
java.lang.String
toString()
WebElementFacade
type(java.lang.CharSequence... keysToSend)
Type a value into a field, making sure that the field is empty first.WebElementFacade
typeAndEnter(java.lang.String value)
Type a value into a field and then press Enter, making sure that the field is empty first.WebElementFacade
typeAndTab(java.lang.String value)
Type a value into a field and then press TAB, making sure that the field is empty first.org.openqa.selenium.support.ui.Wait<org.openqa.selenium.WebDriver>
waitForCondition()
WebElementFacade
waitUntilClickable()
WebElementFacade
waitUntilDisabled()
protected void
waitUntilElementAvailable()
protected void
waitUntilElementPresent()
WebElementFacade
waitUntilEnabled()
WebElementFacade
waitUntilNotVisible()
WebElementFacade
waitUntilPresent()
WebElementFacade
waitUntilVisible()
WebElementFacade
withTimeoutOf(int timeout, java.time.temporal.TemporalUnit unit)
WebElementFacade
withTimeoutOf(int timeout, java.util.concurrent.TimeUnit unit)
WebElementFacade
withTimeoutOf(java.time.Duration duration)
static <T extends WebElementFacade>
TwrapWebElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By bySelector, long timeoutInMilliseconds, long waitForTimeoutInMilliseconds, java.lang.String foundBy)
static <T extends WebElementFacade>
TwrapWebElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element, long timeout)
static <T extends WebElementFacade>
TwrapWebElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element, long timeoutInMilliseconds, long waitForTimeoutInMilliseconds)
static <T extends WebElementFacade>
TwrapWebElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element, long timeoutInMilliseconds, long waitForTimeoutInMilliseconds, java.lang.String foundBy)
static <T extends WebElementFacade>
TwrapWebElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement resolvedELement, org.openqa.selenium.WebElement element, org.openqa.selenium.By bySelector, org.openqa.selenium.support.pagefactory.ElementLocator locator, long timeoutInMilliseconds, long waitForTimeoutInMilliseconds, java.lang.String foundBy)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
WebElementFacadeImpl
public WebElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, org.openqa.selenium.WebElement webElement, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds, org.openqa.selenium.By bySelector) -
WebElementFacadeImpl
public WebElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement webElement, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds, org.openqa.selenium.By bySelector) -
WebElementFacadeImpl
public WebElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, org.openqa.selenium.WebElement webElement, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds) -
WebElementFacadeImpl
public WebElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, org.openqa.selenium.WebElement webElement, long implicitTimeoutInMilliseconds) -
WebElementFacadeImpl
public WebElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, org.openqa.selenium.WebElement webElement, org.openqa.selenium.WebElement resolvedELement, org.openqa.selenium.By bySelector, long timeoutInMilliseconds, long waitForTimeoutInMilliseconds) -
WebElementFacadeImpl
public WebElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, long implicitTimeoutInMilliseconds) -
WebElementFacadeImpl
public WebElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds)
-
-
Method Details
-
wrapWebElement
public static <T extends WebElementFacade> T wrapWebElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element, long timeoutInMilliseconds, long waitForTimeoutInMilliseconds) -
wrapWebElement
public static <T extends WebElementFacade> T wrapWebElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element, long timeoutInMilliseconds, long waitForTimeoutInMilliseconds, java.lang.String foundBy) -
wrapWebElement
public static <T extends WebElementFacade> T wrapWebElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement resolvedELement, org.openqa.selenium.WebElement element, org.openqa.selenium.By bySelector, org.openqa.selenium.support.pagefactory.ElementLocator locator, long timeoutInMilliseconds, long waitForTimeoutInMilliseconds, java.lang.String foundBy) -
wrapWebElement
public static <T extends WebElementFacade> T wrapWebElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.By bySelector, long timeoutInMilliseconds, long waitForTimeoutInMilliseconds, java.lang.String foundBy) -
wrapWebElement
public static <T extends WebElementFacade> T wrapWebElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element, long timeout) -
getElement
public org.openqa.selenium.WebElement getElement()- Specified by:
getElement
in interfaceWebElementFacade
-
getJavascriptExecutorFacade
-
getClock
-
then
- Specified by:
then
in interfaceWebElementFacade
-
thenFind
public WebElementFacade thenFind(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)- Specified by:
thenFind
in interfaceWebElementFacade
-
thenFind
- Specified by:
thenFind
in interfaceWebElementFacade
-
then
- Specified by:
then
in interfaceWebElementFacade
-
findBy
- Specified by:
findBy
in interfaceWebElementFacade
-
findBy
public <T extends WebElementFacade> T findBy(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)- Specified by:
findBy
in interfaceWebElementFacade
-
timeoutInMilliseconds
public long timeoutInMilliseconds() -
thenFindAll
- Specified by:
thenFindAll
in interfaceWebElementFacade
-
thenFindAll
public ListOfWebElementFacades thenFindAll(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)- Specified by:
thenFindAll
in interfaceWebElementFacade
-
findBy
- Specified by:
findBy
in interfaceWebElementFacade
-
find
- Specified by:
find
in interfaceWebElementFacade
-
then
- Specified by:
then
in interfaceWebElementFacade
-
getAttribute
public java.lang.String getAttribute(java.lang.String name)- Specified by:
getAttribute
in interfaceorg.openqa.selenium.WebElement
- Specified by:
getAttribute
in interfaceWebElementFacade
-
thenFindAll
- Specified by:
thenFindAll
in interfaceWebElementFacade
-
findElementByAccessibilityId
public org.openqa.selenium.WebElement findElementByAccessibilityId(java.lang.String id)- Specified by:
findElementByAccessibilityId
in interfaceio.appium.java_client.FindsByAccessibilityId
-
findElementsByAccessibilityId
public java.util.List<org.openqa.selenium.WebElement> findElementsByAccessibilityId(java.lang.String id)- Specified by:
findElementsByAccessibilityId
in interfaceio.appium.java_client.FindsByAccessibilityId
-
findElementByAndroidUIAutomator
public org.openqa.selenium.WebElement findElementByAndroidUIAutomator(java.lang.String using)- Specified by:
findElementByAndroidUIAutomator
in interfaceio.appium.java_client.FindsByAndroidUIAutomator
-
findElementsByAndroidUIAutomator
public java.util.List<org.openqa.selenium.WebElement> findElementsByAndroidUIAutomator(java.lang.String using)- Specified by:
findElementsByAndroidUIAutomator
in interfaceio.appium.java_client.FindsByAndroidUIAutomator
-
getImplicitTimeoutInMilliseconds
public long getImplicitTimeoutInMilliseconds()- Specified by:
getImplicitTimeoutInMilliseconds
in interfaceWebElementFacade
-
getImplicitTimeout
public java.time.Duration getImplicitTimeout() -
withTimeoutOf
- Specified by:
withTimeoutOf
in interfaceWebElementFacade
-
withTimeoutOf
- Specified by:
withTimeoutOf
in interfaceWebElementFacade
-
withTimeoutOf
- Specified by:
withTimeoutOf
in interfaceWebElementFacade
-
isVisible
public boolean isVisible()Is this web element present and visible on the screen This method will not throw an exception if the element is not on the screen at all. If the element is not visible, the method will wait a bit to see if it appears later on.- Specified by:
isVisible
in interfaceWebElementState
-
and
Convenience method to chain method calls more fluently.- Specified by:
and
in interfaceWebElementFacade
-
then
Convenience method to chain method calls more fluently.- Specified by:
then
in interfaceWebElementFacade
-
isCurrentlyVisible
public boolean isCurrentlyVisible()Is this web element present and visible on the screen This method will not throw an exception if the element is not on the screen at all. The method will fail immediately if the element is not visible on the screen. There is a little black magic going on here - the web element class will detect if it is being called by a method called "isCurrently*" and, if so, fail immediately without waiting as it would normally do.- Specified by:
isCurrentlyVisible
in interfaceWebElementState
-
isCurrentlyEnabled
public boolean isCurrentlyEnabled()- Specified by:
isCurrentlyEnabled
in interfaceWebElementState
-
shouldBeVisible
public void shouldBeVisible()Checks whether a web element is visible. Throws an AssertionError if the element is not rendered.- Specified by:
shouldBeVisible
in interfaceWebElementState
-
shouldBeCurrentlyVisible
public void shouldBeCurrentlyVisible()Checks whether a web element is visible. Throws an AssertionError if the element is not rendered.- Specified by:
shouldBeCurrentlyVisible
in interfaceWebElementState
-
shouldNotBeVisible
public void shouldNotBeVisible()Checks whether a web element is not visible. Throws an AssertionError if the element is not rendered.- Specified by:
shouldNotBeVisible
in interfaceWebElementState
-
shouldNotBeCurrentlyVisible
public void shouldNotBeCurrentlyVisible()Checks whether a web element is not visible straight away. Throws an AssertionError if the element is not rendered.- Specified by:
shouldNotBeCurrentlyVisible
in interfaceWebElementState
-
hasFocus
public boolean hasFocus()Does this element currently have the focus.- Specified by:
hasFocus
in interfaceWebElementState
-
containsText
public boolean containsText(java.lang.String value)Does this element contain a given text?- Specified by:
containsText
in interfaceWebElementState
-
containsValue
public boolean containsValue(java.lang.String value)Description copied from interface:WebElementState
Does this element contain a given value attribute?- Specified by:
containsValue
in interfaceWebElementState
-
containsOnlyText
public boolean containsOnlyText(java.lang.String value)Does this element exactly match given text?- Specified by:
containsOnlyText
in interfaceWebElementState
-
containsSelectOption
public boolean containsSelectOption(java.lang.String value)Does this dropdown contain the specified value.- Specified by:
containsSelectOption
in interfaceWebElementState
-
getSelectOptions
public java.util.List<java.lang.String> getSelectOptions()- Specified by:
getSelectOptions
in interfaceWebElementFacade
- Specified by:
getSelectOptions
in interfaceWebElementState
-
getLocator
public org.openqa.selenium.support.pagefactory.ElementLocator getLocator() -
setImplicitTimeout
public void setImplicitTimeout(java.time.Duration implicitTimeout)- Specified by:
setImplicitTimeout
in interfaceConfigurableTimeouts
-
getCurrentImplicitTimeout
public java.time.Duration getCurrentImplicitTimeout()- Specified by:
getCurrentImplicitTimeout
in interfaceConfigurableTimeouts
-
resetTimeouts
public java.time.Duration resetTimeouts()- Specified by:
resetTimeouts
in interfaceConfigurableTimeouts
-
getFoundBy
public java.lang.String getFoundBy() -
shouldContainText
public void shouldContainText(java.lang.String textValue)Check that an element contains a text value- Specified by:
shouldContainText
in interfaceWebElementState
- Parameters:
textValue
-
-
shouldContainOnlyText
public void shouldContainOnlyText(java.lang.String textValue)Check that an element exactly matches a text value- Specified by:
shouldContainOnlyText
in interfaceWebElementState
- Parameters:
textValue
-
-
shouldContainSelectedOption
public void shouldContainSelectedOption(java.lang.String textValue)- Specified by:
shouldContainSelectedOption
in interfaceWebElementState
-
shouldNotContainText
public void shouldNotContainText(java.lang.String textValue)Check that an element does not contain a text value- Specified by:
shouldNotContainText
in interfaceWebElementState
- Parameters:
textValue
-
-
shouldBeEnabled
public void shouldBeEnabled()- Specified by:
shouldBeEnabled
in interfaceWebElementState
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceorg.openqa.selenium.WebElement
- Specified by:
isEnabled
in interfaceWebElementState
-
shouldNotBeEnabled
public void shouldNotBeEnabled()- Specified by:
shouldNotBeEnabled
in interfaceWebElementState
-
isClickable
public boolean isClickable()Check to see if the element is clickable- Specified by:
isClickable
in interfaceWebElementState
-
type
Type a value into a field, making sure that the field is empty first.- Specified by:
type
in interfaceWebElementFacade
- Parameters:
keysToSend
-
-
typeAndEnter
Type a value into a field and then press Enter, making sure that the field is empty first.- Specified by:
typeAndEnter
in interfaceWebElementFacade
- Parameters:
value
-
-
typeAndTab
Type a value into a field and then press TAB, making sure that the field is empty first. This currently is not supported by all browsers, notably Firefox.- Specified by:
typeAndTab
in interfaceWebElementFacade
- Parameters:
value
-
-
setWindowFocus
public void setWindowFocus()- Specified by:
setWindowFocus
in interfaceWebElementFacade
-
select
- Specified by:
select
in interfaceWebElementFacade
-
deselect
- Specified by:
deselect
in interfaceWebElementFacade
-
deselectAll
Deprecated.- Specified by:
deselectAll
in interfaceWebElementFacade
-
deselectByIndex
Deprecated.- Specified by:
deselectByIndex
in interfaceWebElementFacade
-
deselectByVisibleText
Deprecated.- Specified by:
deselectByVisibleText
in interfaceWebElementFacade
-
deselectByValue
Deprecated.- Specified by:
deselectByValue
in interfaceWebElementFacade
-
selectByVisibleText
Deprecated.- Specified by:
selectByVisibleText
in interfaceWebElementFacade
-
getSelectedVisibleTextValue
public java.lang.String getSelectedVisibleTextValue()- Specified by:
getSelectedVisibleTextValue
in interfaceWebElementState
-
getFirstSelectedOptionVisibleText
public java.lang.String getFirstSelectedOptionVisibleText()- Specified by:
getFirstSelectedOptionVisibleText
in interfaceWebElementFacade
-
getSelectedVisibleTexts
public java.util.List<java.lang.String> getSelectedVisibleTexts()- Specified by:
getSelectedVisibleTexts
in interfaceWebElementFacade
-
getFirstSelectedOptionValue
public java.lang.String getFirstSelectedOptionValue()- Specified by:
getFirstSelectedOptionValue
in interfaceWebElementFacade
-
getSelectedValues
public java.util.List<java.lang.String> getSelectedValues()- Specified by:
getSelectedValues
in interfaceWebElementFacade
-
selectByValue
Deprecated.- Specified by:
selectByValue
in interfaceWebElementFacade
-
getSelectedValue
public java.lang.String getSelectedValue()- Specified by:
getSelectedValue
in interfaceWebElementState
-
selectByIndex
Deprecated.- Specified by:
selectByIndex
in interfaceWebElementFacade
-
getScreenshotAs
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target) throws org.openqa.selenium.WebDriverException- Specified by:
getScreenshotAs
in interfaceorg.openqa.selenium.TakesScreenshot
- Throws:
org.openqa.selenium.WebDriverException
-
waitUntilElementAvailable
protected void waitUntilElementAvailable() -
waitUntilElementPresent
protected void waitUntilElementPresent() -
driverIsDisabled
protected boolean driverIsDisabled() -
isPresent
public boolean isPresent()Returns true if an element is present on the screen, whether visible or not.- Specified by:
isPresent
in interfaceWebElementState
-
shouldBePresent
public void shouldBePresent()- Specified by:
shouldBePresent
in interfaceWebElementState
-
shouldNotBePresent
public void shouldNotBePresent()- Specified by:
shouldNotBePresent
in interfaceWebElementState
-
waitUntilVisible
- Specified by:
waitUntilVisible
in interfaceWebElementFacade
-
waitUntilPresent
- Specified by:
waitUntilPresent
in interfaceWebElementFacade
-
waitForCondition
public org.openqa.selenium.support.ui.Wait<org.openqa.selenium.WebDriver> waitForCondition()- Specified by:
waitForCondition
in interfaceWebElementFacade
-
waitUntilNotVisible
- Specified by:
waitUntilNotVisible
in interfaceWebElementFacade
-
getValue
public java.lang.String getValue()- Specified by:
getValue
in interfaceWebElementFacade
- Specified by:
getValue
in interfaceWebElementState
-
isSelected
public boolean isSelected()- Specified by:
isSelected
in interfaceorg.openqa.selenium.WebElement
- Specified by:
isSelected
in interfaceWebElementState
-
getText
public java.lang.String getText()- Specified by:
getText
in interfaceorg.openqa.selenium.WebElement
- Specified by:
getText
in interfaceWebElementFacade
- Specified by:
getText
in interfaceWebElementState
-
getTextContent
public java.lang.String getTextContent()- Specified by:
getTextContent
in interfaceWebElementFacade
-
isDisabled
public boolean isDisabled()- Specified by:
isDisabled
in interfaceWebElementFacade
- Specified by:
isDisabled
in interfaceWebElementState
-
waitUntilEnabled
- Specified by:
waitUntilEnabled
in interfaceWebElementFacade
-
waitUntilClickable
- Specified by:
waitUntilClickable
in interfaceWebElementFacade
-
waitUntilDisabled
- Specified by:
waitUntilDisabled
in interfaceWebElementFacade
-
getTextValue
public java.lang.String getTextValue()- Specified by:
getTextValue
in interfaceWebElementState
-
expect
- Specified by:
expect
in interfaceWebElementState
-
expectingErrorMessage
-
getErrorMessage
protected java.lang.String getErrorMessage(java.lang.String defaultErrorMessage) -
click
Click on an element, with or without waiting for it to be visible and enabled- Specified by:
click
in interfaceWebElementFacade
-
click
public void click()Wait for an element to be visible and enabled, and then click on it.- Specified by:
click
in interfaceorg.openqa.selenium.WebElement
- Specified by:
click
in interfaceWebElementFacade
-
clear
public void clear()- Specified by:
clear
in interfaceorg.openqa.selenium.WebElement
- Specified by:
clear
in interfaceWebElementFacade
-
notifyScreenChange
protected void notifyScreenChange() -
toString
public java.lang.String toString()- Specified by:
toString
in interfaceWebElementFacade
- Overrides:
toString
in classjava.lang.Object
-
submit
public void submit()- Specified by:
submit
in interfaceorg.openqa.selenium.WebElement
-
sendKeys
public void sendKeys(java.lang.CharSequence... keysToSend)- Specified by:
sendKeys
in interfaceorg.openqa.selenium.WebElement
-
getTagName
public java.lang.String getTagName()- Specified by:
getTagName
in interfaceorg.openqa.selenium.WebElement
-
findElements
public java.util.List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)- Specified by:
findElements
in interfaceorg.openqa.selenium.SearchContext
- Specified by:
findElements
in interfaceorg.openqa.selenium.WebElement
-
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)- Specified by:
findElement
in interfaceorg.openqa.selenium.SearchContext
- Specified by:
findElement
in interfaceorg.openqa.selenium.WebElement
-
findElement
public org.openqa.selenium.WebElement findElement(java.lang.String by, java.lang.String using)- Specified by:
findElement
in interfaceio.appium.java_client.FindsByFluentSelector
-
findElements
public java.util.List findElements(java.lang.String by, java.lang.String using)- Specified by:
findElements
in interfaceio.appium.java_client.FindsByFluentSelector
-
isDisplayed
public boolean isDisplayed()Is this element displayed or not? This method avoids the problem of having to parse an element's "style" attribute. This method respects the semantics of the Selenium isDisplayed() method, and will throw an exception if the element is not found. To simply return true or false depending on whether an element is- Specified by:
isDisplayed
in interfaceorg.openqa.selenium.WebElement
- Returns:
- Whether or not the element is displayed
-
getLocation
public org.openqa.selenium.Point getLocation()- Specified by:
getLocation
in interfaceorg.openqa.selenium.WebElement
-
getSize
public org.openqa.selenium.Dimension getSize()- Specified by:
getSize
in interfaceorg.openqa.selenium.WebElement
-
getRect
public org.openqa.selenium.Rectangle getRect()- Specified by:
getRect
in interfaceorg.openqa.selenium.WebElement
-
getCssValue
public java.lang.String getCssValue(java.lang.String propertyName)- Specified by:
getCssValue
in interfaceorg.openqa.selenium.WebElement
-
containsElements
public boolean containsElements(org.openqa.selenium.By bySelector)- Specified by:
containsElements
in interfaceWebElementFacade
-
containsElements
public boolean containsElements(java.lang.String xpathOrCssSelector)- Specified by:
containsElements
in interfaceWebElementFacade
-
shouldContainElements
public void shouldContainElements(org.openqa.selenium.By bySelector)- Specified by:
shouldContainElements
in interfaceWebElementFacade
-
shouldContainElements
public void shouldContainElements(java.lang.String xpathOrCssSelector)- Specified by:
shouldContainElements
in interfaceWebElementFacade
-
hasClass
public boolean hasClass(java.lang.String cssClassName)- Specified by:
hasClass
in interfaceWebElementFacade
-
foundBy
-
getCoordinates
public org.openqa.selenium.interactions.Coordinates getCoordinates()- Specified by:
getCoordinates
in interfaceorg.openqa.selenium.interactions.Locatable
-
getWrappedElement
public org.openqa.selenium.WebElement getWrappedElement()- Specified by:
getWrappedElement
in interfaceorg.openqa.selenium.WrapsElement
-