Class ElementFacadeImpl

java.lang.Object
net.serenitybdd.core.pages.WebElementFacadeImpl
io.meeds.qa.ui.elements.ElementFacadeImpl
All Implemented Interfaces:
ElementFacade, net.serenitybdd.core.pages.WebElementFacade, net.serenitybdd.core.pages.WebElementState, net.thucydides.core.pages.WebElementFacade, net.thucydides.core.pages.WebElementState, net.thucydides.core.webdriver.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:
ButtonElementFacadeImpl, TextBoxElementFacadeImpl, TextElementFacadeImpl

public class ElementFacadeImpl extends net.serenitybdd.core.pages.WebElementFacadeImpl implements ElementFacade
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.slf4j.Logger
     
    protected org.openqa.selenium.WebElement
     
    protected final String
     

    Fields inherited from class net.serenitybdd.core.pages.WebElementFacadeImpl

    NUMBER_OF_TRIES_FOR_UNREADY_ELEMENTS
  • Constructor Summary

    Constructors
    Constructor
    Description
    ElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, String xPathOrCSSSelector, org.openqa.selenium.WebElement element, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds)
     
    ElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, org.openqa.selenium.WebElement element, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Methods for finding element facade inside of this element
    void
    Wrapper which is meant to click on a clickable element.
    Method to find an element inside an element using the xpath and to wrapp it in a BaseElementFacade instance
    protected net.serenitybdd.core.pages.WebElementFacade
     
    org.openqa.selenium.WebDriver
     
    org.openqa.selenium.WebElement
     
    protected net.serenitybdd.core.pages.WebElementFacade
     
    void
    this method is to make the mouse hover over the selected element.
    boolean
     
    boolean
     
    boolean
    this method will check if element is displayed or not without implicit timeout
    boolean
     
    boolean
     
    boolean
    isElementNotVisible(long implicitWaitInMillis)
     
    boolean
    isElementVisible(long implicitWaitInMillis)
     
    boolean
     
    boolean
    Is this web element present and not visible on the screen This method will not throw an exception if the element is visible.
    boolean
     
    boolean
     
    void
    This method will scroll down the element
    void
    This method will scroll the element to the right
    void
    This method will scroll up or down until it reaches the web element
    net.serenitybdd.core.pages.WebElementFacade
     
    net.serenitybdd.core.pages.WebElementFacade
     
    net.serenitybdd.core.pages.WebElementFacade
     
    wrapWebElementFacade(org.openqa.selenium.WebDriver driver, net.serenitybdd.core.pages.WebElementFacade element, org.openqa.selenium.support.pagefactory.ElementLocator locator, String xPathOrCSSSelector, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds)
    This method has the goal of creating a BaseElementFacade instance from a WebElementFacade instance.

    Methods inherited from class net.serenitybdd.core.pages.WebElementFacadeImpl

    and, clear, click, containsElements, containsElements, containsOnlyText, containsSelectOption, containsText, containsValue, contextClick, deselect, deselectAll, deselectByIndex, deselectByValue, deselectByVisibleText, doubleClick, driverIsDisabled, expect, expectingErrorMessage, find, findBy, findBy, findBy, findElement, findElements, findNestedElementsMatching, foundBy, fromWebElements, getAccessibleName, getAriaRole, getAttribute, getClock, getCoordinates, getCssValue, getCurrentImplicitTimeout, getDomAttribute, getDomProperty, getErrorMessage, getFirstSelectedOptionValue, getFirstSelectedOptionVisibleText, getFoundBy, getImplicitTimeout, getImplicitTimeoutInMilliseconds, getJavascriptExecutorFacade, getLocation, getLocator, getRect, getScreenshotAs, getSelectedValue, getSelectedValues, getSelectedVisibleTexts, getSelectedVisibleTextValue, getSelectOptions, getSelectOptionValues, getShadowRoot, getSize, getTagName, getText, getTextContent, getTextValue, getValue, getWrappedElement, hasClass, hasFocus, isSelected, notifyScreenChange, resetTimeouts, select, selectByIndex, selectByValue, selectByVisibleText, sendKeys, setImplicitTimeout, setWindowFocus, shouldBeCurrentlyVisible, shouldBeEnabled, shouldBePresent, shouldBeSelected, shouldBeVisible, shouldContainElements, shouldContainElements, shouldContainOnlyText, shouldContainSelectedOption, shouldContainText, shouldNotBeCurrentlyVisible, shouldNotBeEnabled, shouldNotBePresent, shouldNotBeSelected, shouldNotBeVisible, shouldNotContainText, submit, then, then, then, then, thenFind, thenFind, thenFindAll, thenFindAll, thenFindAll, timeoutInMilliseconds, toString, type, typeAndEnter, typeAndTab, waitForCondition, waitUntilDisabled, waitUntilElementAvailable, waitUntilElementPresent, waitUntilEnabled, waitUntilPresent, withTimeoutOf, withTimeoutOf, withTimeoutOf, wrapWebElement, wrapWebElement, wrapWebElement, wrapWebElement, wrapWebElement, wrapWebElement

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.thucydides.core.webdriver.ConfigurableTimeouts

    getCurrentImplicitTimeout, resetTimeouts, setImplicitTimeout

    Methods inherited from interface org.openqa.selenium.interactions.Locatable

    getCoordinates

    Methods inherited from interface org.openqa.selenium.TakesScreenshot

    getScreenshotAs

    Methods inherited from interface org.openqa.selenium.WebElement

    findElement, findElements, getAccessibleName, getAriaRole, getCssValue, getDomAttribute, getDomProperty, getLocation, getRect, getShadowRoot, getSize, getTagName, isSelected, sendKeys, submit

    Methods inherited from interface net.serenitybdd.core.pages.WebElementFacade

    and, clear, click, containsElements, containsElements, contextClick, deselect, deselectAll, deselectByIndex, deselectByValue, deselectByVisibleText, doubleClick, find, findBy, findBy, findBy, findNestedElementsMatching, getAttribute, getFirstSelectedOptionValue, getFirstSelectedOptionVisibleText, getImplicitTimeoutInMilliseconds, getSelectedValues, getSelectedVisibleTexts, getSelectOptions, getSelectOptionValues, getText, getTextContent, getValue, hasClass, select, selectByIndex, selectByValue, selectByVisibleText, setWindowFocus, shouldContainElements, shouldContainElements, then, then, then, then, thenFind, thenFind, thenFindAll, thenFindAll, thenFindAll, toString, type, typeAndEnter, typeAndTab, waitForCondition, waitUntilDisabled, waitUntilEnabled, waitUntilPresent, withTimeoutOf, withTimeoutOf, withTimeoutOf

    Methods inherited from interface net.serenitybdd.core.pages.WebElementState

    containsOnlyText, containsSelectOption, containsText, containsValue, expect, getSelectedValue, getSelectedVisibleTextValue, getTextValue, hasFocus, isSelected, shouldBeCurrentlyVisible, shouldBeEnabled, shouldBePresent, shouldBeSelected, shouldBeVisible, shouldContainOnlyText, shouldContainSelectedOption, shouldContainText, shouldNotBeCurrentlyVisible, shouldNotBeEnabled, shouldNotBePresent, shouldNotBeSelected, shouldNotBeVisible, shouldNotContainText

    Methods inherited from interface org.openqa.selenium.WrapsElement

    getWrappedElement
  • Field Details

    • LOGGER

      public static final org.slf4j.Logger LOGGER
    • webElement

      protected org.openqa.selenium.WebElement webElement
    • xPathOrCSSSelector

      protected final String xPathOrCSSSelector
  • Constructor Details

    • ElementFacadeImpl

      public ElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, String xPathOrCSSSelector, org.openqa.selenium.WebElement element, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds)
    • ElementFacadeImpl

      public ElementFacadeImpl(org.openqa.selenium.WebDriver driver, org.openqa.selenium.support.pagefactory.ElementLocator locator, org.openqa.selenium.WebElement element, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds)
  • Method Details

    • wrapWebElementFacade

      public static ElementFacadeImpl wrapWebElementFacade(org.openqa.selenium.WebDriver driver, net.serenitybdd.core.pages.WebElementFacade element, org.openqa.selenium.support.pagefactory.ElementLocator locator, String xPathOrCSSSelector, long implicitTimeoutInMilliseconds, long waitForTimeoutInMilliseconds)
      This method has the goal of creating a BaseElementFacade instance from a WebElementFacade instance. Consequently, it would have the access to the BaseElementFacade interface methods
      Parameters:
      driver - WebDriver
      element - WebElementFacade
      locator - ElementLocator
      xPathOrCSSSelector - used xPath or CSS selector to find element
      implicitTimeoutInMilliseconds - configured implicit timeout
      waitForTimeoutInMilliseconds - configured general timeout
      Returns:
      a wrapped ElementFacadeImpl of the webElementFacade
    • click

      public void click()
      Description copied from interface: ElementFacade
      Wrapper which is meant to click on a clickable element.
      Specified by:
      click in interface ElementFacade
      Specified by:
      click in interface org.openqa.selenium.WebElement
      Specified by:
      click in interface net.serenitybdd.core.pages.WebElementFacade
      Overrides:
      click in class net.serenitybdd.core.pages.WebElementFacadeImpl
    • findByXPath

      public ElementFacadeImpl findByXPath(String xpath)
      Description copied from interface: ElementFacade
      Method to find an element inside an element using the xpath and to wrapp it in a BaseElementFacade instance
      Specified by:
      findByXPath in interface ElementFacade
      Parameters:
      xpath - XPath of Sub element
      Returns:
      BaseElementFacade instance of the found element
    • getDriver

      public org.openqa.selenium.WebDriver getDriver()
      Specified by:
      getDriver in interface ElementFacade
      Returns:
      currently used WebDriver
    • getElement

      public org.openqa.selenium.WebElement getElement()
      Specified by:
      getElement in interface net.serenitybdd.core.pages.WebElementFacade
      Overrides:
      getElement in class net.serenitybdd.core.pages.WebElementFacadeImpl
    • hover

      public void hover()
      Description copied from interface: ElementFacade
      this method is to make the mouse hover over the selected element.
      Specified by:
      hover in interface ElementFacade
    • isClickable

      public boolean isClickable()
      Specified by:
      isClickable in interface net.serenitybdd.core.pages.WebElementState
      Overrides:
      isClickable in class net.serenitybdd.core.pages.WebElementFacadeImpl
    • isCurrentlyEnabled

      public boolean isCurrentlyEnabled()
      Specified by:
      isCurrentlyEnabled in interface net.serenitybdd.core.pages.WebElementState
      Overrides:
      isCurrentlyEnabled in class net.serenitybdd.core.pages.WebElementFacadeImpl
    • isCurrentlyVisible

      public boolean isCurrentlyVisible()
      Description copied from interface: ElementFacade
      this method will check if element is displayed or not without implicit timeout
      Specified by:
      isCurrentlyVisible in interface ElementFacade
      Specified by:
      isCurrentlyVisible in interface net.serenitybdd.core.pages.WebElementState
      Overrides:
      isCurrentlyVisible in class net.serenitybdd.core.pages.WebElementFacadeImpl
      Returns:
      true if displayed else false
    • isDisabled

      public boolean isDisabled()
      Specified by:
      isDisabled in interface net.serenitybdd.core.pages.WebElementFacade
      Specified by:
      isDisabled in interface net.serenitybdd.core.pages.WebElementState
      Overrides:
      isDisabled in class net.serenitybdd.core.pages.WebElementFacadeImpl
    • isDisplayed

      public boolean isDisplayed()
      Specified by:
      isDisplayed in interface org.openqa.selenium.WebElement
      Overrides:
      isDisplayed in class net.serenitybdd.core.pages.WebElementFacadeImpl
    • isElementNotVisible

      public boolean isElementNotVisible(long implicitWaitInMillis)
    • isElementVisible

      public boolean isElementVisible(long implicitWaitInMillis)
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface org.openqa.selenium.WebElement
      Specified by:
      isEnabled in interface net.serenitybdd.core.pages.WebElementState
      Overrides:
      isEnabled in class net.serenitybdd.core.pages.WebElementFacadeImpl
    • isNotVisible

      public boolean isNotVisible()
      Description copied from interface: ElementFacade
      Is this web element present and not visible on the screen This method will not throw an exception if the element is visible. If the element is visible, the method will wait a bit to see if it appears later on.
      Specified by:
      isNotVisible in interface ElementFacade
      Returns:
      true if not visible else false
    • isPresent

      public boolean isPresent()
      Specified by:
      isPresent in interface net.serenitybdd.core.pages.WebElementState
      Overrides:
      isPresent in class net.serenitybdd.core.pages.WebElementFacadeImpl
    • isVisible

      public boolean isVisible()
      Specified by:
      isVisible in interface net.serenitybdd.core.pages.WebElementState
      Overrides:
      isVisible in class net.serenitybdd.core.pages.WebElementFacadeImpl
    • scrollDown

      public void scrollDown()
      Description copied from interface: ElementFacade
      This method will scroll down the element
      Specified by:
      scrollDown in interface ElementFacade
    • scrollToTheRight

      public void scrollToTheRight()
      Description copied from interface: ElementFacade
      This method will scroll the element to the right
      Specified by:
      scrollToTheRight in interface ElementFacade
    • scrollToWebElement

      public void scrollToWebElement()
      Description copied from interface: ElementFacade
      This method will scroll up or down until it reaches the web element
      Specified by:
      scrollToWebElement in interface ElementFacade
    • waitUntilClickable

      public net.serenitybdd.core.pages.WebElementFacade waitUntilClickable()
      Specified by:
      waitUntilClickable in interface net.serenitybdd.core.pages.WebElementFacade
      Overrides:
      waitUntilClickable in class net.serenitybdd.core.pages.WebElementFacadeImpl
    • waitUntilNotVisible

      public net.serenitybdd.core.pages.WebElementFacade waitUntilNotVisible()
      Specified by:
      waitUntilNotVisible in interface net.serenitybdd.core.pages.WebElementFacade
      Overrides:
      waitUntilNotVisible in class net.serenitybdd.core.pages.WebElementFacadeImpl
    • waitUntilVisible

      public net.serenitybdd.core.pages.WebElementFacade waitUntilVisible()
      Specified by:
      waitUntilVisible in interface net.serenitybdd.core.pages.WebElementFacade
      Overrides:
      waitUntilVisible in class net.serenitybdd.core.pages.WebElementFacadeImpl
    • checkXpathFormat

      protected void checkXpathFormat(String xpath)
      Methods for finding element facade inside of this element
    • findSubElementFacadeByXPathOrCSS

      protected net.serenitybdd.core.pages.WebElementFacade findSubElementFacadeByXPathOrCSS(String xpathOrCss)
    • getWebElementFacadeByXPathOrCSS

      protected net.serenitybdd.core.pages.WebElementFacade getWebElementFacadeByXPathOrCSS(String xpathOrCss)