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 Details

    • WebElementFacadeStub

      public WebElementFacadeStub()
  • Method Details

    • getElement

      public org.openqa.selenium.WebElement getElement()
      Specified by:
      getElement in interface WebElementFacade
    • then

      public WebElementFacade then​(java.lang.String xpathOrCssSelector)
      Specified by:
      then in interface WebElementFacade
    • thenFind

      public WebElementFacade thenFind​(java.lang.String xpathOrCssSelector)
      Specified by:
      thenFind in interface WebElementFacade
    • thenFind

      public WebElementFacade thenFind​(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)
      Specified by:
      thenFind in interface WebElementFacade
    • then

      public WebElementFacade then​(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)
      Specified by:
      then in interface WebElementFacade
    • findBy

      public WebElementFacade findBy​(java.lang.String xpathOrCssSelector)
      Specified by:
      findBy in interface WebElementFacade
    • findBy

      public WebElementFacade findBy​(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)
      Specified by:
      findBy in interface WebElementFacade
    • thenFindAll

      public ListOfWebElementFacades thenFindAll​(java.lang.String xpathOrCssSelector)
      Specified by:
      thenFindAll in interface WebElementFacade
    • thenFindAll

      public ListOfWebElementFacades thenFindAll​(java.lang.String xpathOrCssSelector, java.lang.Object... arguments)
      Specified by:
      thenFindAll in interface WebElementFacade
    • findBy

      public WebElementFacade findBy​(org.openqa.selenium.By selector)
      Specified by:
      findBy in interface WebElementFacade
    • find

      public WebElementFacade find​(org.openqa.selenium.By bySelector)
      Specified by:
      find in interface WebElementFacade
    • then

      public WebElementFacade then​(org.openqa.selenium.By bySelector)
      Specified by:
      then in interface WebElementFacade
    • getAttribute

      public java.lang.String getAttribute​(java.lang.String name)
      Specified by:
      getAttribute in interface org.openqa.selenium.WebElement
      Specified by:
      getAttribute in interface WebElementFacade
    • thenFindAll

      public ListOfWebElementFacades thenFindAll​(org.openqa.selenium.By selector)
      Specified by:
      thenFindAll in interface WebElementFacade
    • getImplicitTimeoutInMilliseconds

      public long getImplicitTimeoutInMilliseconds()
      Specified by:
      getImplicitTimeoutInMilliseconds in interface WebElementFacade
    • withTimeoutOf

      public WebElementFacade withTimeoutOf​(int timeout, java.util.concurrent.TimeUnit unit)
      Specified by:
      withTimeoutOf in interface WebElementFacade
    • withTimeoutOf

      public WebElementFacade withTimeoutOf​(int timeout, java.time.temporal.TemporalUnit unit)
      Specified by:
      withTimeoutOf in interface WebElementFacade
    • withTimeoutOf

      public WebElementFacade withTimeoutOf​(java.time.Duration duration)
      Specified by:
      withTimeoutOf in interface WebElementFacade
    • 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 interface WebElementState
    • and

      public WebElementFacade and()
      Convenience method to chain method calls more fluently.
      Specified by:
      and in interface WebElementFacade
    • then

      public WebElementFacade then()
      Convenience method to chain method calls more fluently.
      Specified by:
      then in interface WebElementFacade
    • 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 interface WebElementState
    • isCurrentlyEnabled

      public boolean isCurrentlyEnabled()
      Specified by:
      isCurrentlyEnabled in interface WebElementState
    • shouldBeVisible

      public void shouldBeVisible()
      Checks whether a web element is visible. Throws an AssertionError if the element is not rendered.
      Specified by:
      shouldBeVisible in interface WebElementState
    • shouldBeCurrentlyVisible

      public void shouldBeCurrentlyVisible()
      Checks whether a web element is visible. Throws an AssertionError if the element is not rendered.
      Specified by:
      shouldBeCurrentlyVisible in interface WebElementState
    • 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 interface WebElementState
    • 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 interface WebElementState
    • hasFocus

      public boolean hasFocus()
      Does this element currently have the focus.
      Specified by:
      hasFocus in interface WebElementState
    • containsText

      public boolean containsText​(java.lang.String value)
      Does this element contain a given text?
      Specified by:
      containsText in interface WebElementState
    • 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 interface WebElementState
    • containsOnlyText

      public boolean containsOnlyText​(java.lang.String value)
      Does this element exactly match given text?
      Specified by:
      containsOnlyText in interface WebElementState
    • containsSelectOption

      public boolean containsSelectOption​(java.lang.String value)
      Does this dropdown contain the specified value.
      Specified by:
      containsSelectOption in interface WebElementState
    • getSelectOptions

      public java.util.List<java.lang.String> getSelectOptions()
      Specified by:
      getSelectOptions in interface WebElementFacade
      Specified by:
      getSelectOptions in interface WebElementState
    • getFirstSelectedOptionVisibleText

      public java.lang.String getFirstSelectedOptionVisibleText()
      Specified by:
      getFirstSelectedOptionVisibleText in interface WebElementFacade
    • getSelectedVisibleTexts

      public java.util.List<java.lang.String> getSelectedVisibleTexts()
      Specified by:
      getSelectedVisibleTexts in interface WebElementFacade
    • getFirstSelectedOptionValue

      public java.lang.String getFirstSelectedOptionValue()
      Specified by:
      getFirstSelectedOptionValue in interface WebElementFacade
    • getSelectedValues

      public java.util.List<java.lang.String> getSelectedValues()
      Specified by:
      getSelectedValues in interface WebElementFacade
    • shouldContainText

      public void shouldContainText​(java.lang.String textValue)
      Check that an element contains a text value
      Specified by:
      shouldContainText in interface WebElementState
      Parameters:
      textValue -
    • shouldContainOnlyText

      public void shouldContainOnlyText​(java.lang.String textValue)
      Check that an element exactly matches a text value
      Specified by:
      shouldContainOnlyText in interface WebElementState
      Parameters:
      textValue -
    • shouldContainSelectedOption

      public void shouldContainSelectedOption​(java.lang.String textValue)
      Specified by:
      shouldContainSelectedOption in interface WebElementState
    • shouldNotContainText

      public void shouldNotContainText​(java.lang.String textValue)
      Check that an element does not contain a text value
      Specified by:
      shouldNotContainText in interface WebElementState
      Parameters:
      textValue -
    • shouldBeEnabled

      public void shouldBeEnabled()
      Specified by:
      shouldBeEnabled in interface WebElementState
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface org.openqa.selenium.WebElement
      Specified by:
      isEnabled in interface WebElementState
    • shouldNotBeEnabled

      public void shouldNotBeEnabled()
      Specified by:
      shouldNotBeEnabled in interface WebElementState
    • type

      public WebElementFacade type​(java.lang.CharSequence... keysToSend)
      Type a value into a field, making sure that the field is empty first.
      Specified by:
      type in interface WebElementFacade
      Parameters:
      keysToSend -
    • typeAndEnter

      public WebElementFacade typeAndEnter​(java.lang.String value)
      Type a value into a field and then press Enter, making sure that the field is empty first.
      Specified by:
      typeAndEnter in interface WebElementFacade
      Parameters:
      value -
    • typeAndTab

      public WebElementFacade typeAndTab​(java.lang.String value)
      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 interface WebElementFacade
      Parameters:
      value -
    • setWindowFocus

      public void setWindowFocus()
      Specified by:
      setWindowFocus in interface WebElementFacade
    • select

      public FluentDropdownSelect select()
      Specified by:
      select in interface WebElementFacade
    • deselect

      public FluentDropdownDeselect deselect()
      Specified by:
      deselect in interface WebElementFacade
    • deselectAll

      public WebElementFacade deselectAll()
      Specified by:
      deselectAll in interface WebElementFacade
    • deselectByVisibleText

      public WebElementFacade deselectByVisibleText​(java.lang.String label)
      Specified by:
      deselectByVisibleText in interface WebElementFacade
    • deselectByValue

      public WebElementFacade deselectByValue​(java.lang.String value)
      Specified by:
      deselectByValue in interface WebElementFacade
    • deselectByIndex

      public WebElementFacade deselectByIndex​(int indexValue)
      Specified by:
      deselectByIndex in interface WebElementFacade
    • selectByVisibleText

      public WebElementFacade selectByVisibleText​(java.lang.String label)
      Specified by:
      selectByVisibleText in interface WebElementFacade
    • getSelectedVisibleTextValue

      public java.lang.String getSelectedVisibleTextValue()
      Specified by:
      getSelectedVisibleTextValue in interface WebElementState
    • selectByValue

      public WebElementFacade selectByValue​(java.lang.String value)
      Specified by:
      selectByValue in interface WebElementFacade
    • getSelectedValue

      public java.lang.String getSelectedValue()
      Specified by:
      getSelectedValue in interface WebElementState
    • selectByIndex

      public WebElementFacade selectByIndex​(int indexValue)
      Specified by:
      selectByIndex in interface WebElementFacade
    • isPresent

      public boolean isPresent()
      Specified by:
      isPresent in interface WebElementState
    • shouldBePresent

      public void shouldBePresent()
      Specified by:
      shouldBePresent in interface WebElementState
    • shouldNotBePresent

      public void shouldNotBePresent()
      Specified by:
      shouldNotBePresent in interface WebElementState
    • waitUntilVisible

      public WebElementFacade waitUntilVisible()
      Specified by:
      waitUntilVisible in interface WebElementFacade
    • waitUntilPresent

      public WebElementFacade waitUntilPresent()
      Specified by:
      waitUntilPresent in interface WebElementFacade
    • waitForCondition

      public org.openqa.selenium.support.ui.Wait<org.openqa.selenium.WebDriver> waitForCondition()
      Specified by:
      waitForCondition in interface WebElementFacade
    • waitUntilNotVisible

      public WebElementFacade waitUntilNotVisible()
      Specified by:
      waitUntilNotVisible in interface WebElementFacade
    • getValue

      public java.lang.String getValue()
      Specified by:
      getValue in interface WebElementFacade
      Specified by:
      getValue in interface WebElementState
    • isSelected

      public boolean isSelected()
      Specified by:
      isSelected in interface org.openqa.selenium.WebElement
      Specified by:
      isSelected in interface WebElementState
    • getText

      public java.lang.String getText()
      Specified by:
      getText in interface org.openqa.selenium.WebElement
      Specified by:
      getText in interface WebElementFacade
      Specified by:
      getText in interface WebElementState
    • getTextContent

      public java.lang.String getTextContent()
      Specified by:
      getTextContent in interface WebElementFacade
    • isDisabled

      public boolean isDisabled()
      Specified by:
      isDisabled in interface WebElementFacade
      Specified by:
      isDisabled in interface WebElementState
    • waitUntilClickable

      public WebElementFacade waitUntilClickable()
      Specified by:
      waitUntilClickable in interface WebElementFacade
    • waitUntilEnabled

      public WebElementFacade waitUntilEnabled()
      Specified by:
      waitUntilEnabled in interface WebElementFacade
    • waitUntilDisabled

      public WebElementFacade waitUntilDisabled()
      Specified by:
      waitUntilDisabled in interface WebElementFacade
    • getTextValue

      public java.lang.String getTextValue()
      Specified by:
      getTextValue in interface WebElementState
    • expect

      public WebElementState expect​(java.lang.String errorMessage)
      Specified by:
      expect in interface WebElementState
    • isClickable

      public boolean isClickable()
      Specified by:
      isClickable in interface WebElementState
    • expectingErrorMessage

      protected WebElementState expectingErrorMessage​(java.lang.String errorMessage)
    • click

      public void click()
      Wait for an element to be visible and enabled, and then click on it.
      Specified by:
      click in interface org.openqa.selenium.WebElement
      Specified by:
      click in interface WebElementFacade
    • click

      public void click​(ClickStrategy clickStrategy)
      Specified by:
      click in interface WebElementFacade
    • clear

      public void clear()
      Specified by:
      clear in interface org.openqa.selenium.WebElement
      Specified by:
      clear in interface WebElementFacade
    • toString

      public java.lang.String toString()
      Specified by:
      toString in interface WebElementFacade
      Overrides:
      toString in class java.lang.Object
    • submit

      public void submit()
      Specified by:
      submit in interface org.openqa.selenium.WebElement
    • sendKeys

      public void sendKeys​(java.lang.CharSequence... keysToSend)
      Specified by:
      sendKeys in interface org.openqa.selenium.WebElement
    • getTagName

      public java.lang.String getTagName()
      Specified by:
      getTagName in interface org.openqa.selenium.WebElement
    • findElements

      public java.util.List<org.openqa.selenium.WebElement> findElements​(org.openqa.selenium.By by)
      Specified by:
      findElements in interface org.openqa.selenium.SearchContext
      Specified by:
      findElements in interface org.openqa.selenium.WebElement
    • findElement

      public org.openqa.selenium.WebElement findElement​(org.openqa.selenium.By by)
      Specified by:
      findElement in interface org.openqa.selenium.SearchContext
      Specified by:
      findElement in interface org.openqa.selenium.WebElement
    • findElement

      public org.openqa.selenium.WebElement findElement​(java.lang.String by, java.lang.String using)
      Specified by:
      findElement in interface io.appium.java_client.FindsByFluentSelector
    • findElements

      public java.util.List findElements​(java.lang.String by, java.lang.String using)
      Specified by:
      findElements in interface io.appium.java_client.FindsByFluentSelector
    • isDisplayed

      public boolean isDisplayed()
      Specified by:
      isDisplayed in interface org.openqa.selenium.WebElement
    • getLocation

      public org.openqa.selenium.Point getLocation()
      Specified by:
      getLocation in interface org.openqa.selenium.WebElement
    • getSize

      public org.openqa.selenium.Dimension getSize()
      Specified by:
      getSize in interface org.openqa.selenium.WebElement
    • getRect

      public org.openqa.selenium.Rectangle getRect()
      Specified by:
      getRect in interface org.openqa.selenium.WebElement
    • getCssValue

      public java.lang.String getCssValue​(java.lang.String propertyName)
      Specified by:
      getCssValue in interface org.openqa.selenium.WebElement
    • getWrappedElement

      public org.openqa.selenium.WebElement getWrappedElement()
      Specified by:
      getWrappedElement in interface org.openqa.selenium.WrapsElement
    • getCoordinates

      public org.openqa.selenium.interactions.Coordinates getCoordinates()
      Specified by:
      getCoordinates in interface org.openqa.selenium.interactions.Locatable
    • findElementByAccessibilityId

      public org.openqa.selenium.WebElement findElementByAccessibilityId​(java.lang.String using)
      Specified by:
      findElementByAccessibilityId in interface io.appium.java_client.FindsByAccessibilityId
    • findElementsByAccessibilityId

      public java.util.List<org.openqa.selenium.WebElement> findElementsByAccessibilityId​(java.lang.String using)
      Specified by:
      findElementsByAccessibilityId in interface io.appium.java_client.FindsByAccessibilityId
    • findElementByAndroidUIAutomator

      public org.openqa.selenium.WebElement findElementByAndroidUIAutomator​(java.lang.String using)
      Specified by:
      findElementByAndroidUIAutomator in interface io.appium.java_client.FindsByAndroidUIAutomator
    • findElementsByAndroidUIAutomator

      public java.util.List<org.openqa.selenium.WebElement> findElementsByAndroidUIAutomator​(java.lang.String using)
      Specified by:
      findElementsByAndroidUIAutomator in interface io.appium.java_client.FindsByAndroidUIAutomator
    • setImplicitTimeout

      public void setImplicitTimeout​(java.time.Duration implicitTimeout)
      Specified by:
      setImplicitTimeout in interface ConfigurableTimeouts
    • getCurrentImplicitTimeout

      public java.time.Duration getCurrentImplicitTimeout()
      Specified by:
      getCurrentImplicitTimeout in interface ConfigurableTimeouts
    • resetTimeouts

      public java.time.Duration resetTimeouts()
      Specified by:
      resetTimeouts in interface ConfigurableTimeouts
    • containsElements

      public boolean containsElements​(org.openqa.selenium.By selector)
      Specified by:
      containsElements in interface WebElementFacade
    • containsElements

      public boolean containsElements​(java.lang.String xpathOrCssSelector)
      Specified by:
      containsElements in interface WebElementFacade
    • shouldContainElements

      public void shouldContainElements​(org.openqa.selenium.By selector)
      Specified by:
      shouldContainElements in interface WebElementFacade
    • shouldContainElements

      public void shouldContainElements​(java.lang.String xpathOrCssSelector)
      Specified by:
      shouldContainElements in interface WebElementFacade
    • hasClass

      public boolean hasClass​(java.lang.String cssClassName)
      Specified by:
      hasClass in interface WebElementFacade
    • getScreenshotAs

      public <X> X getScreenshotAs​(org.openqa.selenium.OutputType<X> target) throws org.openqa.selenium.WebDriverException
      Specified by:
      getScreenshotAs in interface org.openqa.selenium.TakesScreenshot
      Throws:
      org.openqa.selenium.WebDriverException