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.voidclear()voidclick()Wait for an element to be visible and enabled, and then click on it.voidclick(ClickStrategy clickStrategy) booleancontainsElements(String xpathOrCssSelector) booleancontainsElements(org.openqa.selenium.By selector) booleancontainsOnlyText(String value) Does this element exactly match given text?booleancontainsSelectOption(String value) Does this dropdown contain the specified value.booleancontainsText(String value) Does this element contain a given text?booleancontainsValue(String value) Does this element contain a given value attribute?deselect()deselectByIndex(int indexValue) deselectByValue(String value) deselectByVisibleText(String label) protected WebElementStateexpectingErrorMessage(String errorMessage) find(org.openqa.selenium.By bySelector) findBy(org.openqa.selenium.By selector) org.openqa.selenium.WebElementfindElement(String by, String using) org.openqa.selenium.WebElementfindElement(org.openqa.selenium.By by) org.openqa.selenium.WebElementorg.openqa.selenium.WebElementfindElements(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.CoordinatesgetCssValue(String propertyName) org.openqa.selenium.WebElementlongorg.openqa.selenium.Pointorg.openqa.selenium.RectanglegetRect()<X> XgetScreenshotAs(org.openqa.selenium.OutputType<X> target) org.openqa.selenium.DimensiongetSize()getText()getValue()org.openqa.selenium.WebElementbooleanbooleanhasFocus()Does this element currently have the focus.booleanbooleanbooleanIs 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.booleanbooleanbooleanbooleanbooleanbooleanIs 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) voidsendKeys(CharSequence... keysToSend) voidsetImplicitTimeout(Duration implicitTimeout) voidChecks 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 valuevoidsubmit()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:
getElementin interfaceWebElementFacade
-
then
- Specified by:
thenin interfaceWebElementFacade
-
thenFind
- Specified by:
thenFindin interfaceWebElementFacade
-
thenFind
- Specified by:
thenFindin interfaceWebElementFacade
-
then
- Specified by:
thenin interfaceWebElementFacade
-
findBy
- Specified by:
findByin interfaceWebElementFacade
-
findBy
- Specified by:
findByin interfaceWebElementFacade
-
thenFindAll
- Specified by:
thenFindAllin interfaceWebElementFacade
-
thenFindAll
- Specified by:
thenFindAllin interfaceWebElementFacade
-
findBy
- Specified by:
findByin interfaceWebElementFacade
-
find
- Specified by:
findin interfaceWebElementFacade
-
then
- Specified by:
thenin interfaceWebElementFacade
-
getAttribute
- Specified by:
getAttributein interfaceorg.openqa.selenium.WebElement- Specified by:
getAttributein interfaceWebElementFacade- Specified by:
getAttributein interfaceWebElementState
-
thenFindAll
- Specified by:
thenFindAllin interfaceWebElementFacade
-
getImplicitTimeoutInMilliseconds
public long getImplicitTimeoutInMilliseconds()- Specified by:
getImplicitTimeoutInMillisecondsin interfaceWebElementFacade
-
withTimeoutOf
- Specified by:
withTimeoutOfin interfaceWebElementFacade
-
withTimeoutOf
- Specified by:
withTimeoutOfin interfaceWebElementFacade
-
withTimeoutOf
- Specified by:
withTimeoutOfin 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:
isVisiblein interfaceWebElementState
-
and
Convenience method to chain method calls more fluently.- Specified by:
andin interfaceWebElementFacade
-
then
Convenience method to chain method calls more fluently.- Specified by:
thenin 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:
isCurrentlyVisiblein interfaceWebElementState
-
isCurrentlyEnabled
public boolean isCurrentlyEnabled()- Specified by:
isCurrentlyEnabledin interfaceWebElementState
-
shouldBeVisible
Checks whether a web element is visible. Throws an AssertionError if the element is not rendered.- Specified by:
shouldBeVisiblein interfaceWebElementState
-
shouldBeCurrentlyVisible
Checks whether a web element is visible. Throws an AssertionError if the element is not rendered.- Specified by:
shouldBeCurrentlyVisiblein interfaceWebElementState
-
shouldNotBeVisible
Checks whether a web element is not visible. Throws an AssertionError if the element is not rendered.- Specified by:
shouldNotBeVisiblein interfaceWebElementState
-
shouldNotBeCurrentlyVisible
Checks whether a web element is not visible straight away. Throws an AssertionError if the element is not rendered.- Specified by:
shouldNotBeCurrentlyVisiblein interfaceWebElementState
-
hasFocus
public boolean hasFocus()Does this element currently have the focus.- Specified by:
hasFocusin interfaceWebElementState
-
containsText
Does this element contain a given text?- Specified by:
containsTextin interfaceWebElementState
-
containsValue
Description copied from interface:WebElementStateDoes this element contain a given value attribute?- Specified by:
containsValuein interfaceWebElementState
-
containsOnlyText
Does this element exactly match given text?- Specified by:
containsOnlyTextin interfaceWebElementState
-
containsSelectOption
Does this dropdown contain the specified value.- Specified by:
containsSelectOptionin interfaceWebElementState
-
getSelectOptions
- Specified by:
getSelectOptionsin interfaceWebElementFacade- Specified by:
getSelectOptionsin interfaceWebElementState
-
getFirstSelectedOptionVisibleText
- Specified by:
getFirstSelectedOptionVisibleTextin interfaceWebElementFacade
-
getSelectedVisibleTexts
- Specified by:
getSelectedVisibleTextsin interfaceWebElementFacade- Specified by:
getSelectedVisibleTextsin interfaceWebElementState
-
getFirstSelectedOptionValue
- Specified by:
getFirstSelectedOptionValuein interfaceWebElementFacade
-
getSelectedValues
- Specified by:
getSelectedValuesin interfaceWebElementFacade- Specified by:
getSelectedValuesin interfaceWebElementState
-
shouldContainText
Check that an element contains a text value- Specified by:
shouldContainTextin interfaceWebElementState- Parameters:
textValue-
-
shouldContainOnlyText
Check that an element exactly matches a text value- Specified by:
shouldContainOnlyTextin interfaceWebElementState- Parameters:
textValue-
-
shouldContainSelectedOption
- Specified by:
shouldContainSelectedOptionin interfaceWebElementState
-
shouldNotContainText
Check that an element does not contain a text value- Specified by:
shouldNotContainTextin interfaceWebElementState- Parameters:
textValue-
-
shouldBeEnabled
- Specified by:
shouldBeEnabledin interfaceWebElementState
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceorg.openqa.selenium.WebElement- Specified by:
isEnabledin interfaceWebElementState
-
shouldNotBeEnabled
- Specified by:
shouldNotBeEnabledin interfaceWebElementState
-
type
Type a value into a field, making sure that the field is empty first.- Specified by:
typein interfaceWebElementFacade- Parameters:
keysToSend-
-
typeAndEnter
Type a value into a field and then press Enter, making sure that the field is empty first.- Specified by:
typeAndEnterin 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:
typeAndTabin interfaceWebElementFacade- Parameters:
value-
-
setWindowFocus
public void setWindowFocus()- Specified by:
setWindowFocusin interfaceWebElementFacade
-
select
- Specified by:
selectin interfaceWebElementFacade
-
deselect
- Specified by:
deselectin interfaceWebElementFacade
-
deselectAll
- Specified by:
deselectAllin interfaceWebElementFacade
-
deselectByVisibleText
- Specified by:
deselectByVisibleTextin interfaceWebElementFacade
-
deselectByValue
- Specified by:
deselectByValuein interfaceWebElementFacade
-
deselectByIndex
- Specified by:
deselectByIndexin interfaceWebElementFacade
-
selectByVisibleText
- Specified by:
selectByVisibleTextin interfaceWebElementFacade
-
getSelectedVisibleTextValue
- Specified by:
getSelectedVisibleTextValuein interfaceWebElementState
-
selectByValue
- Specified by:
selectByValuein interfaceWebElementFacade
-
getSelectedValue
- Specified by:
getSelectedValuein interfaceWebElementState
-
selectByIndex
- Specified by:
selectByIndexin interfaceWebElementFacade
-
isPresent
public boolean isPresent()- Specified by:
isPresentin interfaceWebElementState
-
shouldBePresent
- Specified by:
shouldBePresentin interfaceWebElementState
-
shouldNotBePresent
- Specified by:
shouldNotBePresentin interfaceWebElementState
-
waitUntilVisible
- Specified by:
waitUntilVisiblein interfaceWebElementFacade
-
waitUntilPresent
- Specified by:
waitUntilPresentin interfaceWebElementFacade
-
waitForCondition
public org.openqa.selenium.support.ui.Wait<org.openqa.selenium.WebDriver> waitForCondition()- Specified by:
waitForConditionin interfaceWebElementFacade
-
waitUntilNotVisible
- Specified by:
waitUntilNotVisiblein interfaceWebElementFacade
-
getValue
- Specified by:
getValuein interfaceWebElementFacade- Specified by:
getValuein interfaceWebElementState
-
isSelected
public boolean isSelected()- Specified by:
isSelectedin interfaceorg.openqa.selenium.WebElement- Specified by:
isSelectedin interfaceWebElementState
-
getText
- Specified by:
getTextin interfaceorg.openqa.selenium.WebElement- Specified by:
getTextin interfaceWebElementFacade- Specified by:
getTextin interfaceWebElementState
-
getTextContent
- Specified by:
getTextContentin interfaceWebElementFacade
-
isDisabled
public boolean isDisabled()- Specified by:
isDisabledin interfaceWebElementFacade- Specified by:
isDisabledin interfaceWebElementState
-
waitUntilClickable
- Specified by:
waitUntilClickablein interfaceWebElementFacade
-
waitUntilEnabled
- Specified by:
waitUntilEnabledin interfaceWebElementFacade
-
waitUntilDisabled
- Specified by:
waitUntilDisabledin interfaceWebElementFacade
-
getTextValue
- Specified by:
getTextValuein interfaceWebElementState
-
expect
- Specified by:
expectin interfaceWebElementState
-
isClickable
public boolean isClickable()- Specified by:
isClickablein interfaceWebElementState
-
expectingErrorMessage
-
click
public void click()Wait for an element to be visible and enabled, and then click on it.- Specified by:
clickin interfaceorg.openqa.selenium.WebElement- Specified by:
clickin interfaceWebElementFacade
-
click
- Specified by:
clickin interfaceWebElementFacade
-
clear
public void clear()- Specified by:
clearin interfaceorg.openqa.selenium.WebElement- Specified by:
clearin interfaceWebElementFacade
-
toString
- Specified by:
toStringin interfaceWebElementFacade- Overrides:
toStringin classObject
-
submit
public void submit()- Specified by:
submitin interfaceorg.openqa.selenium.WebElement
-
sendKeys
- Specified by:
sendKeysin interfaceorg.openqa.selenium.WebElement
-
getTagName
- Specified by:
getTagNamein interfaceorg.openqa.selenium.WebElement
-
findElements
- Specified by:
findElementsin interfaceorg.openqa.selenium.SearchContext- Specified by:
findElementsin interfaceorg.openqa.selenium.WebElement
-
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by) - Specified by:
findElementin interfaceorg.openqa.selenium.SearchContext- Specified by:
findElementin interfaceorg.openqa.selenium.WebElement
-
findElement
- Specified by:
findElementin interfaceio.appium.java_client.FindsByFluentSelector
-
findElements
- Specified by:
findElementsin interfaceio.appium.java_client.FindsByFluentSelector
-
isDisplayed
public boolean isDisplayed()- Specified by:
isDisplayedin interfaceorg.openqa.selenium.WebElement
-
getLocation
public org.openqa.selenium.Point getLocation()- Specified by:
getLocationin interfaceorg.openqa.selenium.WebElement
-
getSize
public org.openqa.selenium.Dimension getSize()- Specified by:
getSizein interfaceorg.openqa.selenium.WebElement
-
getRect
public org.openqa.selenium.Rectangle getRect()- Specified by:
getRectin interfaceorg.openqa.selenium.WebElement
-
getCssValue
- Specified by:
getCssValuein interfaceorg.openqa.selenium.WebElement
-
getWrappedElement
public org.openqa.selenium.WebElement getWrappedElement()- Specified by:
getWrappedElementin interfaceorg.openqa.selenium.WrapsElement
-
getCoordinates
public org.openqa.selenium.interactions.Coordinates getCoordinates()- Specified by:
getCoordinatesin interfaceorg.openqa.selenium.interactions.Locatable
-
findElementByAccessibilityId
- Specified by:
findElementByAccessibilityIdin interfaceio.appium.java_client.FindsByAccessibilityId
-
findElementsByAccessibilityId
- Specified by:
findElementsByAccessibilityIdin interfaceio.appium.java_client.FindsByAccessibilityId
-
findElementByAndroidUIAutomator
- Specified by:
findElementByAndroidUIAutomatorin interfaceio.appium.java_client.FindsByAndroidUIAutomator
-
findElementsByAndroidUIAutomator
- Specified by:
findElementsByAndroidUIAutomatorin interfaceio.appium.java_client.FindsByAndroidUIAutomator
-
setImplicitTimeout
- Specified by:
setImplicitTimeoutin interfaceConfigurableTimeouts
-
getCurrentImplicitTimeout
- Specified by:
getCurrentImplicitTimeoutin interfaceConfigurableTimeouts
-
resetTimeouts
- Specified by:
resetTimeoutsin interfaceConfigurableTimeouts
-
containsElements
public boolean containsElements(org.openqa.selenium.By selector) - Specified by:
containsElementsin interfaceWebElementFacade
-
containsElements
- Specified by:
containsElementsin interfaceWebElementFacade
-
shouldContainElements
- Specified by:
shouldContainElementsin interfaceWebElementFacade
-
shouldContainElements
- Specified by:
shouldContainElementsin interfaceWebElementFacade
-
hasClass
- Specified by:
hasClassin interfaceWebElementFacade
-
getScreenshotAs
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target) throws org.openqa.selenium.WebDriverException - Specified by:
getScreenshotAsin interfaceorg.openqa.selenium.TakesScreenshot- Throws:
org.openqa.selenium.WebDriverException
-