Class BaseHook<T>

    • Constructor Detail

      • BaseHook

        public BaseHook​(FluentControl control,
                        ComponentInstantiator instantiator,
                        Supplier<org.openqa.selenium.WebElement> elementSupplier,
                        Supplier<org.openqa.selenium.support.pagefactory.ElementLocator> locatorSupplier,
                        Supplier<String> toStringSupplier,
                        T options)
        Creates a new base hook.
        Parameters:
        control - control interface
        instantiator - component instantiator
        elementSupplier - element supplier
        locatorSupplier - element locator supplier
        toStringSupplier - element toString supplier
        options - hook options
    • Method Detail

      • getElement

        public final org.openqa.selenium.WebElement getElement()
        Get the underlying element of the hook.

        Can be another hook, or a real element.

        Returns:
        underlying element
      • getWrappedElement

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

        public final org.openqa.selenium.support.pagefactory.ElementLocator getElementLocator()
        Get the underlying element locator of the hook.
        Returns:
        underlying element locator
      • getCoordinates

        public org.openqa.selenium.interactions.Coordinates getCoordinates()
        Get coordinates of the underlying element.
        Specified by:
        getCoordinates in interface org.openqa.selenium.interactions.Locatable
        Returns:
        coordinates of underlying element
      • newOptions

        protected T newOptions()
        Builds default options.
        Returns:
        default options
      • getInstantiator

        public ComponentInstantiator getInstantiator()
        Get the component instantiator.
        Returns:
        component instantiator
      • getOptions

        public T getOptions()
        Description copied from interface: FluentHook
        Get the options of the hook.
        Specified by:
        getOptions in interface FluentHook<T>
        Returns:
        hook options
      • sendKeys

        public void sendKeys​(CharSequence... charSequences)
        Specified by:
        sendKeys in interface org.openqa.selenium.WebElement
      • getScreenshotAs

        public <X> X getScreenshotAs​(org.openqa.selenium.OutputType<X> outputType)
                              throws org.openqa.selenium.WebDriverException
        Specified by:
        getScreenshotAs in interface org.openqa.selenium.TakesScreenshot
        Throws:
        org.openqa.selenium.WebDriverException
      • 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
      • isSelected

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

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

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

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

        public 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
      • submit

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

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

        public String getTagName()
        Specified by:
        getTagName 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
      • getText

        public String getText()
        Specified by:
        getText in interface org.openqa.selenium.WebElement
      • click

        public void click()
        Specified by:
        click in interface org.openqa.selenium.WebElement
      • getAttribute

        public String getAttribute​(String name)
        Specified by:
        getAttribute in interface org.openqa.selenium.WebElement
      • clear

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

        public org.openqa.selenium.WebElement findElement()
        Specified by:
        findElement in interface org.openqa.selenium.support.pagefactory.ElementLocator
      • findElements

        public List<org.openqa.selenium.WebElement> findElements()
        Specified by:
        findElements in interface org.openqa.selenium.support.pagefactory.ElementLocator