Class WebElementFacadeStub
java.lang.Object
net.thucydides.core.webdriver.stubs.WebElementFacadeStub
- All Implemented Interfaces:
io.appium.java_client.FindsByAccessibilityId
,io.appium.java_client.FindsByAndroidUIAutomator
,io.appium.java_client.FindsByFluentSelector
,WebElementFacade
,WebElementState
,ConfigurableTimeouts
,org.openqa.selenium.interactions.Locatable
,org.openqa.selenium.SearchContext
,org.openqa.selenium.TakesScreenshot
,org.openqa.selenium.WebElement
,org.openqa.selenium.WrapsElement
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionand()
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) boolean
containsElements
(String xpathOrCssSelector) boolean
containsElements
(org.openqa.selenium.By selector) boolean
containsOnlyText
(String value) Does this element exactly match given text?boolean
containsSelectOption
(String value) Does this dropdown contain the specified value.boolean
containsText
(String value) Does this element contain a given text?boolean
containsValue
(String value) Does this element contain a given value attribute?deselect()
deselectByIndex
(int indexValue) deselectByValue
(String value) deselectByVisibleText
(String label) protected WebElementState
expectingErrorMessage
(String errorMessage) find
(org.openqa.selenium.By bySelector) findBy
(org.openqa.selenium.By selector) org.openqa.selenium.WebElement
findElement
(String by, String using) org.openqa.selenium.WebElement
findElement
(org.openqa.selenium.By by) org.openqa.selenium.WebElement
org.openqa.selenium.WebElement
findElements
(String by, String using) List<org.openqa.selenium.WebElement>
findElements
(org.openqa.selenium.By by) List<org.openqa.selenium.WebElement>
List<org.openqa.selenium.WebElement>
getAttribute
(String name) org.openqa.selenium.interactions.Coordinates
getCssValue
(String propertyName) org.openqa.selenium.WebElement
long
org.openqa.selenium.Point
org.openqa.selenium.Rectangle
getRect()
<X> X
getScreenshotAs
(org.openqa.selenium.OutputType<X> target) org.openqa.selenium.Dimension
getSize()
getText()
getValue()
org.openqa.selenium.WebElement
boolean
boolean
hasFocus()
Does this element currently have the focus.boolean
boolean
boolean
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
boolean
boolean
boolean
boolean
boolean
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.select()
selectByIndex
(int indexValue) selectByValue
(String value) selectByVisibleText
(String label) void
sendKeys
(CharSequence... keysToSend) void
setImplicitTimeout
(Duration implicitTimeout) void
Checks whether a web element is visible.Checks whether a web element is visible.shouldContainElements
(String xpathOrCssSelector) shouldContainElements
(org.openqa.selenium.By selector) shouldContainOnlyText
(String textValue) Check that an element exactly matches a text valueshouldContainSelectedOption
(String textValue) shouldContainText
(String textValue) Check that an element contains a text valueChecks whether a web element is not visible straight away.Checks whether a web element is not visible.shouldNotContainText
(String textValue) Check that an element does not contain a text valuevoid
submit()
then()
Convenience method to chain method calls more fluently.then
(org.openqa.selenium.By bySelector) thenFindAll
(String xpathOrCssSelector) thenFindAll
(String xpathOrCssSelector, Object... arguments) thenFindAll
(org.openqa.selenium.By... selector) toString()
type
(CharSequence... keysToSend) Type a value into a field, making sure that the field is empty first.typeAndEnter
(String value) Type a value into a field and then press Enter, making sure that the field is empty first.typeAndTab
(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>
withTimeoutOf
(int timeout, TemporalUnit unit) withTimeoutOf
(int timeout, TimeUnit unit) withTimeoutOf
(Duration duration)
-
Constructor Details
-
WebElementFacadeStub
public WebElementFacadeStub()
-
-
Method Details
-
getElement
public org.openqa.selenium.WebElement getElement()- Specified by:
getElement
in interfaceWebElementFacade
-
then
- Specified by:
then
in interfaceWebElementFacade
-
thenFind
- Specified by:
thenFind
in interfaceWebElementFacade
-
thenFind
- Specified by:
thenFind
in interfaceWebElementFacade
-
then
- Specified by:
then
in interfaceWebElementFacade
-
findBy
- Specified by:
findBy
in interfaceWebElementFacade
-
findBy
- Specified by:
findBy
in interfaceWebElementFacade
-
thenFindAll
- Specified by:
thenFindAll
in interfaceWebElementFacade
-
thenFindAll
- Specified by:
thenFindAll
in interfaceWebElementFacade
-
findBy
- Specified by:
findBy
in interfaceWebElementFacade
-
find
- Specified by:
find
in interfaceWebElementFacade
-
then
- Specified by:
then
in interfaceWebElementFacade
-
getAttribute
- Specified by:
getAttribute
in interfaceorg.openqa.selenium.WebElement
- Specified by:
getAttribute
in interfaceWebElementFacade
- Specified by:
getAttribute
in interfaceWebElementState
-
thenFindAll
- Specified by:
thenFindAll
in interfaceWebElementFacade
-
getImplicitTimeoutInMilliseconds
public long getImplicitTimeoutInMilliseconds()- Specified by:
getImplicitTimeoutInMilliseconds
in interfaceWebElementFacade
-
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
Checks whether a web element is visible. Throws an AssertionError if the element is not rendered.- Specified by:
shouldBeVisible
in interfaceWebElementState
-
shouldBeCurrentlyVisible
Checks whether a web element is visible. Throws an AssertionError if the element is not rendered.- Specified by:
shouldBeCurrentlyVisible
in interfaceWebElementState
-
shouldNotBeVisible
Checks whether a web element is not visible. Throws an AssertionError if the element is not rendered.- Specified by:
shouldNotBeVisible
in interfaceWebElementState
-
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
Does this element contain a given text?- Specified by:
containsText
in interfaceWebElementState
-
containsValue
Description copied from interface:WebElementState
Does this element contain a given value attribute?- Specified by:
containsValue
in interfaceWebElementState
-
containsOnlyText
Does this element exactly match given text?- Specified by:
containsOnlyText
in interfaceWebElementState
-
containsSelectOption
Does this dropdown contain the specified value.- Specified by:
containsSelectOption
in interfaceWebElementState
-
getSelectOptions
- Specified by:
getSelectOptions
in interfaceWebElementFacade
- Specified by:
getSelectOptions
in interfaceWebElementState
-
getFirstSelectedOptionVisibleText
- Specified by:
getFirstSelectedOptionVisibleText
in interfaceWebElementFacade
-
getSelectedVisibleTexts
- Specified by:
getSelectedVisibleTexts
in interfaceWebElementFacade
- Specified by:
getSelectedVisibleTexts
in interfaceWebElementState
-
getFirstSelectedOptionValue
- Specified by:
getFirstSelectedOptionValue
in interfaceWebElementFacade
-
getSelectedValues
- Specified by:
getSelectedValues
in interfaceWebElementFacade
- Specified by:
getSelectedValues
in interfaceWebElementState
-
shouldContainText
Check that an element contains a text value- Specified by:
shouldContainText
in interfaceWebElementState
- Parameters:
textValue
-
-
shouldContainOnlyText
Check that an element exactly matches a text value- Specified by:
shouldContainOnlyText
in interfaceWebElementState
- Parameters:
textValue
-
-
shouldContainSelectedOption
- Specified by:
shouldContainSelectedOption
in interfaceWebElementState
-
shouldNotContainText
Check that an element does not contain a text value- Specified by:
shouldNotContainText
in interfaceWebElementState
- Parameters:
textValue
-
-
shouldBeEnabled
- Specified by:
shouldBeEnabled
in interfaceWebElementState
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceorg.openqa.selenium.WebElement
- Specified by:
isEnabled
in interfaceWebElementState
-
shouldNotBeEnabled
- Specified by:
shouldNotBeEnabled
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
- Specified by:
deselectAll
in interfaceWebElementFacade
-
deselectByVisibleText
- Specified by:
deselectByVisibleText
in interfaceWebElementFacade
-
deselectByValue
- Specified by:
deselectByValue
in interfaceWebElementFacade
-
deselectByIndex
- Specified by:
deselectByIndex
in interfaceWebElementFacade
-
selectByVisibleText
- Specified by:
selectByVisibleText
in interfaceWebElementFacade
-
getSelectedVisibleTextValue
- Specified by:
getSelectedVisibleTextValue
in interfaceWebElementState
-
selectByValue
- Specified by:
selectByValue
in interfaceWebElementFacade
-
getSelectedValue
- Specified by:
getSelectedValue
in interfaceWebElementState
-
selectByIndex
- Specified by:
selectByIndex
in interfaceWebElementFacade
-
isPresent
public boolean isPresent()- Specified by:
isPresent
in interfaceWebElementState
-
shouldBePresent
- Specified by:
shouldBePresent
in interfaceWebElementState
-
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
- 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
- Specified by:
getText
in interfaceorg.openqa.selenium.WebElement
- Specified by:
getText
in interfaceWebElementFacade
- Specified by:
getText
in interfaceWebElementState
-
getTextContent
- Specified by:
getTextContent
in interfaceWebElementFacade
-
isDisabled
public boolean isDisabled()- Specified by:
isDisabled
in interfaceWebElementFacade
- Specified by:
isDisabled
in interfaceWebElementState
-
waitUntilClickable
- Specified by:
waitUntilClickable
in interfaceWebElementFacade
-
waitUntilEnabled
- Specified by:
waitUntilEnabled
in interfaceWebElementFacade
-
waitUntilDisabled
- Specified by:
waitUntilDisabled
in interfaceWebElementFacade
-
getTextValue
- Specified by:
getTextValue
in interfaceWebElementState
-
expect
- Specified by:
expect
in interfaceWebElementState
-
isClickable
public boolean isClickable()- Specified by:
isClickable
in interfaceWebElementState
-
expectingErrorMessage
-
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
-
click
- Specified by:
click
in interfaceWebElementFacade
-
clear
public void clear()- Specified by:
clear
in interfaceorg.openqa.selenium.WebElement
- Specified by:
clear
in interfaceWebElementFacade
-
toString
- Specified by:
toString
in interfaceWebElementFacade
- Overrides:
toString
in classObject
-
submit
public void submit()- Specified by:
submit
in interfaceorg.openqa.selenium.WebElement
-
sendKeys
- Specified by:
sendKeys
in interfaceorg.openqa.selenium.WebElement
-
getTagName
- Specified by:
getTagName
in interfaceorg.openqa.selenium.WebElement
-
findElements
- 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
- Specified by:
findElement
in interfaceio.appium.java_client.FindsByFluentSelector
-
findElements
- Specified by:
findElements
in interfaceio.appium.java_client.FindsByFluentSelector
-
isDisplayed
public boolean isDisplayed()- Specified by:
isDisplayed
in interfaceorg.openqa.selenium.WebElement
-
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
- Specified by:
getCssValue
in interfaceorg.openqa.selenium.WebElement
-
getWrappedElement
public org.openqa.selenium.WebElement getWrappedElement()- Specified by:
getWrappedElement
in interfaceorg.openqa.selenium.WrapsElement
-
getCoordinates
public org.openqa.selenium.interactions.Coordinates getCoordinates()- Specified by:
getCoordinates
in interfaceorg.openqa.selenium.interactions.Locatable
-
findElementByAccessibilityId
- Specified by:
findElementByAccessibilityId
in interfaceio.appium.java_client.FindsByAccessibilityId
-
findElementsByAccessibilityId
- Specified by:
findElementsByAccessibilityId
in interfaceio.appium.java_client.FindsByAccessibilityId
-
findElementByAndroidUIAutomator
- Specified by:
findElementByAndroidUIAutomator
in interfaceio.appium.java_client.FindsByAndroidUIAutomator
-
findElementsByAndroidUIAutomator
- Specified by:
findElementsByAndroidUIAutomator
in interfaceio.appium.java_client.FindsByAndroidUIAutomator
-
setImplicitTimeout
- Specified by:
setImplicitTimeout
in interfaceConfigurableTimeouts
-
getCurrentImplicitTimeout
- Specified by:
getCurrentImplicitTimeout
in interfaceConfigurableTimeouts
-
resetTimeouts
- Specified by:
resetTimeouts
in interfaceConfigurableTimeouts
-
containsElements
public boolean containsElements(org.openqa.selenium.By selector) - Specified by:
containsElements
in interfaceWebElementFacade
-
containsElements
- Specified by:
containsElements
in interfaceWebElementFacade
-
shouldContainElements
- Specified by:
shouldContainElements
in interfaceWebElementFacade
-
shouldContainElements
- Specified by:
shouldContainElements
in interfaceWebElementFacade
-
hasClass
- Specified by:
hasClass
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
-