Interface LocatorHandler<T>

Type Parameters:
T - type of the result retrieved by the element locator
All Superinterfaces:
LocatorStatusHandler
All Known Implementing Classes:
AbstractLocatorAndInvocationHandler, AbstractLocatorHandler, ComponentHandler, ListHandler

public interface LocatorHandler<T> extends LocatorStatusHandler
Public interface to control handler for proxies of List of FluentWebElement and FluentWebElement.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Add a listener for this locator handler.
    org.openqa.selenium.support.pagefactory.ElementLocator
    Retrieve the element locator used by this proxy, with hooks applied.
    Retrieve the invocation target of this proxy handler.
    org.openqa.selenium.support.pagefactory.ElementLocator
    Retrieve the element locator used by this proxy, without any hook applied.
    Get the result retrieved by the element locator, without any hook applied.
    Retrieve the message context from this proxy locator.
    default org.openqa.selenium.NoSuchElementException
    Build a NoSuchElementException with message from this locator.
    default void
    now()
    If result is not loaded, load result immediately.
    boolean
    Removes a proxy element listener.
    void
    setHooks(HookChainBuilder hookChainBuilder, List<HookDefinition<?>> hookDefinitions)
    Apply this hook list.

    Methods inherited from interface io.fluentlenium.core.proxy.LocatorStatusHandler

    loaded, present, reset
  • Method Details

    • getLocator

      org.openqa.selenium.support.pagefactory.ElementLocator getLocator()
      Retrieve the element locator used by this proxy, without any hook applied.
      Returns:
      element locator
    • getLocatorResult

      T getLocatorResult()
      Get the result retrieved by the element locator, without any hook applied.
      Returns:
      results of the element locator
    • getHookLocator

      org.openqa.selenium.support.pagefactory.ElementLocator getHookLocator()
      Retrieve the element locator used by this proxy, with hooks applied.
      Returns:
      element locator wrapped with hooks
    • getInvocationTarget

      T getInvocationTarget(Method method)
      Retrieve the invocation target of this proxy handler.
      Parameters:
      method - method to invoke
      Returns:
      invocation target
    • setHooks

      void setHooks(HookChainBuilder hookChainBuilder, List<HookDefinition<?>> hookDefinitions)
      Apply this hook list.
      Parameters:
      hookChainBuilder - hook chain builder
      hookDefinitions - hook definitions
    • now

      default void now()
      If result is not loaded, load result immediately. If it's already loaded, it has no effect.
      Specified by:
      now in interface LocatorStatusHandler
    • addListener

      boolean addListener(ProxyElementListener listener)
      Add a listener for this locator handler.
      Parameters:
      listener - listener to add, which will be notified when result is searched and found
      Returns:
      true if the listener was added, false otherwise
    • removeListener

      boolean removeListener(ProxyElementListener listener)
      Removes a proxy element listener.
      Parameters:
      listener - listener to remove
      Returns:
      true if the listener was removed, false otherwise
    • noSuchElement

      default org.openqa.selenium.NoSuchElementException noSuchElement()
      Build a NoSuchElementException with message from this locator.
      Returns:
      Exception with not present message
    • getMessageContext

      String getMessageContext()
      Retrieve the message context from this proxy locator.
      Returns:
      message context