Class BaseHook<T>

Type Parameters:
T - type of options for the hook
All Implemented Interfaces:
Configuration, ConfigurationMutator, ConfigurationProperties, InputControl, AlertControl, CapabilitiesControl, ComponentInstantiator, CssControl, EventsControl, FluentContainer, FluentControl, FluentHook<T>, FluentInjectControl, NavigationControl, PerformanceTimingControl, JavascriptControl, SearchControl<FluentWebElement>, SeleniumDriverControl, SnapshotControl, AwaitControl, ChromiumControl, org.openqa.selenium.interactions.Locatable, org.openqa.selenium.SearchContext, org.openqa.selenium.support.pagefactory.ElementLocator, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsElement
Direct Known Subclasses:
BaseFluentHook

public class BaseHook<T> extends DefaultFluentContainer implements FluentHook<T>
Base hook implementation.

You should extends this class to implement your own hook.

  • Constructor Details

    • 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 Details

    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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