Class AbstractUIObject

    • Field Detail

      • name

        protected java.lang.String name
      • rootElement

        protected org.openqa.selenium.WebElement rootElement
      • rootBy

        protected org.openqa.selenium.By rootBy
    • Constructor Detail

      • AbstractUIObject

        public AbstractUIObject​(org.openqa.selenium.WebDriver driver)
        Initializes UI object using PageFactory. Whole browser window is used as search context
        Parameters:
        driver - WebDriver
      • AbstractUIObject

        public AbstractUIObject​(org.openqa.selenium.WebDriver driver,
                                org.openqa.selenium.SearchContext searchContext)
        Initializes UI object using PageFactory. Browser area for internal elements initialization is bordered by SearchContext instance. If WebDriver object is used as search context then whole browser window will be used for initialization of ExtendedWebElement fields inside. Note: implement this constructor if you want your AbstractUIObject instances marked with FindBy to be auto-initialized on AbstractPage inheritors
        Parameters:
        driver - WebDriver instance to initialize UI Object fields using PageFactory
        searchContext - Window area that will be used for locating of internal elements
    • Method Detail

      • isUIObjectPresent

        public boolean isUIObjectPresent​(long timeout)
        Verifies if root WebElement presents on page. If AbstractUIObject field on AbstractPage is marked with FindBy annotation then this locator will be used to instantiate rootElement
        Parameters:
        timeout - - max timeout for waiting until rootElement appear
        Returns:
        true - if rootElement is enabled and visible on browser's screen; false - otherwise
      • isUIObjectPresent

        public boolean isUIObjectPresent()
      • setUiLoadedMarker

        public void setUiLoadedMarker​(ExtendedWebElement uiLoadedMarker)
      • getName

        public java.lang.String getName()
      • setName

        public void setName​(java.lang.String name)
      • getRootElement

        public org.openqa.selenium.WebElement getRootElement()
      • setRootElement

        public void setRootElement​(org.openqa.selenium.WebElement element)
      • getRootBy

        public org.openqa.selenium.By getRootBy()
      • setRootBy

        public void setRootBy​(org.openqa.selenium.By rootBy)
      • assertUIObjectPresent

        public void assertUIObjectPresent()
        Checks presence of UIObject root element on the page and throws Assertion error in case if it's missing
      • assertUIObjectPresent

        public void assertUIObjectPresent​(long timeout)
        Checks presence of UIObject root element on the page and throws Assertion error in case if it's missing
        Parameters:
        timeout - long
      • assertUIObjectNotPresent

        public void assertUIObjectNotPresent()
        Checks missing of UIObject root element on the page and throws Assertion error in case if it presents
      • assertUIObjectNotPresent

        public void assertUIObjectNotPresent​(long timeout)
        Checks missing of UIObject root element on the page and throws Assertion error in case if it presents
        Parameters:
        timeout - long