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
public class WebElementFacadeStub extends java.lang.Object implements WebElementFacade
-
Constructor Summary
Constructors Constructor Description WebElementFacadeStub() -
Method Summary
Modifier and Type Method Description WebElementFacadeand()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(java.lang.String xpathOrCssSelector)booleancontainsElements(org.openqa.selenium.By selector)booleancontainsOnlyText(java.lang.String value)Does this element exactly match given text?booleancontainsSelectOption(java.lang.String value)Does this dropdown contain the specified value.booleancontainsText(java.lang.String value)Does this element contain a given text?booleancontainsValue(java.lang.String value)Does this element contain a given value attribute?FluentDropdownDeselectdeselect()WebElementFacadedeselectAll()WebElementFacadedeselectByIndex(int indexValue)WebElementFacadedeselectByValue(java.lang.String value)WebElementFacadedeselectByVisibleText(java.lang.String label)WebElementStateexpect(java.lang.String errorMessage)protected WebElementStateexpectingErrorMessage(java.lang.String errorMessage)WebElementFacadefind(org.openqa.selenium.By bySelector)WebElementFacadefindBy(java.lang.String xpathOrCssSelector)WebElementFacadefindBy(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)WebElementFacadefindBy(org.openqa.selenium.By selector)org.openqa.selenium.WebElementfindElement(java.lang.String by, java.lang.String using)org.openqa.selenium.WebElementfindElement(org.openqa.selenium.By by)org.openqa.selenium.WebElementfindElementByAccessibilityId(java.lang.String using)org.openqa.selenium.WebElementfindElementByAndroidUIAutomator(java.lang.String using)java.util.ListfindElements(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 using)java.util.List<org.openqa.selenium.WebElement>findElementsByAndroidUIAutomator(java.lang.String using)java.lang.StringgetAttribute(java.lang.String name)org.openqa.selenium.interactions.CoordinatesgetCoordinates()java.lang.StringgetCssValue(java.lang.String propertyName)java.time.DurationgetCurrentImplicitTimeout()org.openqa.selenium.WebElementgetElement()java.lang.StringgetFirstSelectedOptionValue()java.lang.StringgetFirstSelectedOptionVisibleText()longgetImplicitTimeoutInMilliseconds()org.openqa.selenium.PointgetLocation()org.openqa.selenium.RectanglegetRect()<X> XgetScreenshotAs(org.openqa.selenium.OutputType<X> target)java.lang.StringgetSelectedValue()java.util.List<java.lang.String>getSelectedValues()java.util.List<java.lang.String>getSelectedVisibleTexts()java.lang.StringgetSelectedVisibleTextValue()java.util.List<java.lang.String>getSelectOptions()org.openqa.selenium.DimensiongetSize()java.lang.StringgetTagName()java.lang.StringgetText()java.lang.StringgetTextContent()java.lang.StringgetTextValue()java.lang.StringgetValue()org.openqa.selenium.WebElementgetWrappedElement()booleanhasClass(java.lang.String cssClassName)booleanhasFocus()Does this element currently have the focus.booleanisClickable()booleanisCurrentlyEnabled()booleanisCurrentlyVisible()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.booleanisDisabled()booleanisDisplayed()booleanisEnabled()booleanisPresent()booleanisSelected()booleanisVisible()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.java.time.DurationresetTimeouts()FluentDropdownSelectselect()WebElementFacadeselectByIndex(int indexValue)WebElementFacadeselectByValue(java.lang.String value)WebElementFacadeselectByVisibleText(java.lang.String label)voidsendKeys(java.lang.CharSequence... keysToSend)voidsetImplicitTimeout(java.time.Duration implicitTimeout)voidsetWindowFocus()voidshouldBeCurrentlyVisible()Checks whether a web element is visible.voidshouldBeEnabled()voidshouldBePresent()voidshouldBeVisible()Checks whether a web element is visible.voidshouldContainElements(java.lang.String xpathOrCssSelector)voidshouldContainElements(org.openqa.selenium.By selector)voidshouldContainOnlyText(java.lang.String textValue)Check that an element exactly matches a text valuevoidshouldContainSelectedOption(java.lang.String textValue)voidshouldContainText(java.lang.String textValue)Check that an element contains a text valuevoidshouldNotBeCurrentlyVisible()Checks whether a web element is not visible straight away.voidshouldNotBeEnabled()voidshouldNotBePresent()voidshouldNotBeVisible()Checks whether a web element is not visible.voidshouldNotContainText(java.lang.String textValue)Check that an element does not contain a text valuevoidsubmit()WebElementFacadethen()Convenience method to chain method calls more fluently.WebElementFacadethen(java.lang.String xpathOrCssSelector)WebElementFacadethen(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)WebElementFacadethen(org.openqa.selenium.By bySelector)WebElementFacadethenFind(java.lang.String xpathOrCssSelector)WebElementFacadethenFind(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)ListOfWebElementFacadesthenFindAll(java.lang.String xpathOrCssSelector)ListOfWebElementFacadesthenFindAll(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)ListOfWebElementFacadesthenFindAll(org.openqa.selenium.By selector)java.lang.StringtoString()WebElementFacadetype(java.lang.CharSequence... keysToSend)Type a value into a field, making sure that the field is empty first.WebElementFacadetypeAndEnter(java.lang.String value)Type a value into a field and then press Enter, making sure that the field is empty first.WebElementFacadetypeAndTab(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()WebElementFacadewaitUntilClickable()WebElementFacadewaitUntilDisabled()WebElementFacadewaitUntilEnabled()WebElementFacadewaitUntilNotVisible()WebElementFacadewaitUntilPresent()WebElementFacadewaitUntilVisible()WebElementFacadewithTimeoutOf(int timeout, java.time.temporal.TemporalUnit unit)WebElementFacadewithTimeoutOf(int timeout, java.util.concurrent.TimeUnit unit)WebElementFacadewithTimeoutOf(java.time.Duration duration)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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
public WebElementFacade thenFind(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)- 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
public ListOfWebElementFacades thenFindAll(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)- Specified by:
thenFindAllin interfaceWebElementFacade
-
findBy
- Specified by:
findByin interfaceWebElementFacade
-
find
- Specified by:
findin interfaceWebElementFacade
-
then
- Specified by:
thenin interfaceWebElementFacade
-
getAttribute
public java.lang.String getAttribute(java.lang.String name)- Specified by:
getAttributein interfaceorg.openqa.selenium.WebElement- Specified by:
getAttributein interfaceWebElementFacade
-
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
public void shouldBeVisible()Checks whether a web element is visible. Throws an AssertionError if the element is not rendered.- Specified by:
shouldBeVisiblein interfaceWebElementState
-
shouldBeCurrentlyVisible
public void shouldBeCurrentlyVisible()Checks whether a web element is visible. Throws an AssertionError if the element is not rendered.- Specified by:
shouldBeCurrentlyVisiblein interfaceWebElementState
-
shouldNotBeVisible
public void shouldNotBeVisible()Checks whether a web element is not visible. Throws an AssertionError if the element is not rendered.- Specified by:
shouldNotBeVisiblein 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:
shouldNotBeCurrentlyVisiblein interfaceWebElementState
-
hasFocus
public boolean hasFocus()Does this element currently have the focus.- Specified by:
hasFocusin interfaceWebElementState
-
containsText
public boolean containsText(java.lang.String value)Does this element contain a given text?- Specified by:
containsTextin interfaceWebElementState
-
containsValue
public boolean containsValue(java.lang.String value)Description copied from interface:WebElementStateDoes this element contain a given value attribute?- Specified by:
containsValuein interfaceWebElementState
-
containsOnlyText
public boolean containsOnlyText(java.lang.String value)Does this element exactly match given text?- Specified by:
containsOnlyTextin interfaceWebElementState
-
containsSelectOption
public boolean containsSelectOption(java.lang.String value)Does this dropdown contain the specified value.- Specified by:
containsSelectOptionin interfaceWebElementState
-
getSelectOptions
public java.util.List<java.lang.String> getSelectOptions()- Specified by:
getSelectOptionsin interfaceWebElementFacade- Specified by:
getSelectOptionsin interfaceWebElementState
-
getFirstSelectedOptionVisibleText
public java.lang.String getFirstSelectedOptionVisibleText()- Specified by:
getFirstSelectedOptionVisibleTextin interfaceWebElementFacade
-
getSelectedVisibleTexts
public java.util.List<java.lang.String> getSelectedVisibleTexts()- Specified by:
getSelectedVisibleTextsin interfaceWebElementFacade
-
getFirstSelectedOptionValue
public java.lang.String getFirstSelectedOptionValue()- Specified by:
getFirstSelectedOptionValuein interfaceWebElementFacade
-
getSelectedValues
public java.util.List<java.lang.String> getSelectedValues()- Specified by:
getSelectedValuesin interfaceWebElementFacade
-
shouldContainText
public void shouldContainText(java.lang.String textValue)Check that an element contains a text value- Specified by:
shouldContainTextin interfaceWebElementState- Parameters:
textValue-
-
shouldContainOnlyText
public void shouldContainOnlyText(java.lang.String textValue)Check that an element exactly matches a text value- Specified by:
shouldContainOnlyTextin interfaceWebElementState- Parameters:
textValue-
-
shouldContainSelectedOption
public void shouldContainSelectedOption(java.lang.String textValue)- Specified by:
shouldContainSelectedOptionin interfaceWebElementState
-
shouldNotContainText
public void shouldNotContainText(java.lang.String textValue)Check that an element does not contain a text value- Specified by:
shouldNotContainTextin interfaceWebElementState- Parameters:
textValue-
-
shouldBeEnabled
public void shouldBeEnabled()- Specified by:
shouldBeEnabledin interfaceWebElementState
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceorg.openqa.selenium.WebElement- Specified by:
isEnabledin interfaceWebElementState
-
shouldNotBeEnabled
public void 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
public java.lang.String getSelectedVisibleTextValue()- Specified by:
getSelectedVisibleTextValuein interfaceWebElementState
-
selectByValue
- Specified by:
selectByValuein interfaceWebElementFacade
-
getSelectedValue
public java.lang.String getSelectedValue()- Specified by:
getSelectedValuein interfaceWebElementState
-
selectByIndex
- Specified by:
selectByIndexin interfaceWebElementFacade
-
isPresent
public boolean isPresent()- Specified by:
isPresentin interfaceWebElementState
-
shouldBePresent
public void shouldBePresent()- Specified by:
shouldBePresentin interfaceWebElementState
-
shouldNotBePresent
public void 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
public java.lang.String 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
public java.lang.String getText()- Specified by:
getTextin interfaceorg.openqa.selenium.WebElement- Specified by:
getTextin interfaceWebElementFacade- Specified by:
getTextin interfaceWebElementState
-
getTextContent
public java.lang.String 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
public java.lang.String 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
public java.lang.String toString()- Specified by:
toStringin interfaceWebElementFacade- Overrides:
toStringin classjava.lang.Object
-
submit
public void submit()- Specified by:
submitin interfaceorg.openqa.selenium.WebElement
-
sendKeys
public void sendKeys(java.lang.CharSequence... keysToSend)- Specified by:
sendKeysin interfaceorg.openqa.selenium.WebElement
-
getTagName
public java.lang.String getTagName()- Specified by:
getTagNamein interfaceorg.openqa.selenium.WebElement
-
findElements
public java.util.List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)- 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
public org.openqa.selenium.WebElement findElement(java.lang.String by, java.lang.String using)- Specified by:
findElementin interfaceio.appium.java_client.FindsByFluentSelector
-
findElements
public java.util.List findElements(java.lang.String by, java.lang.String using)- 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
public java.lang.String getCssValue(java.lang.String propertyName)- 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
public org.openqa.selenium.WebElement findElementByAccessibilityId(java.lang.String using)- Specified by:
findElementByAccessibilityIdin interfaceio.appium.java_client.FindsByAccessibilityId
-
findElementsByAccessibilityId
public java.util.List<org.openqa.selenium.WebElement> findElementsByAccessibilityId(java.lang.String using)- Specified by:
findElementsByAccessibilityIdin interfaceio.appium.java_client.FindsByAccessibilityId
-
findElementByAndroidUIAutomator
public org.openqa.selenium.WebElement findElementByAndroidUIAutomator(java.lang.String using)- Specified by:
findElementByAndroidUIAutomatorin interfaceio.appium.java_client.FindsByAndroidUIAutomator
-
findElementsByAndroidUIAutomator
public java.util.List<org.openqa.selenium.WebElement> findElementsByAndroidUIAutomator(java.lang.String using)- Specified by:
findElementsByAndroidUIAutomatorin interfaceio.appium.java_client.FindsByAndroidUIAutomator
-
setImplicitTimeout
public void setImplicitTimeout(java.time.Duration implicitTimeout)- Specified by:
setImplicitTimeoutin interfaceConfigurableTimeouts
-
getCurrentImplicitTimeout
public java.time.Duration getCurrentImplicitTimeout()- Specified by:
getCurrentImplicitTimeoutin interfaceConfigurableTimeouts
-
resetTimeouts
public java.time.Duration resetTimeouts()- Specified by:
resetTimeoutsin interfaceConfigurableTimeouts
-
containsElements
public boolean containsElements(org.openqa.selenium.By selector)- Specified by:
containsElementsin interfaceWebElementFacade
-
containsElements
public boolean containsElements(java.lang.String xpathOrCssSelector)- Specified by:
containsElementsin interfaceWebElementFacade
-
shouldContainElements
public void shouldContainElements(org.openqa.selenium.By selector)- Specified by:
shouldContainElementsin interfaceWebElementFacade
-
shouldContainElements
public void shouldContainElements(java.lang.String xpathOrCssSelector)- Specified by:
shouldContainElementsin interfaceWebElementFacade
-
hasClass
public boolean hasClass(java.lang.String cssClassName)- 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
-