Class ComponentHandler

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler, LocatorHandler<org.openqa.selenium.WebElement>

    public class ComponentHandler
    extends AbstractLocatorHandler<org.openqa.selenium.WebElement>
    implements java.lang.reflect.InvocationHandler, LocatorHandler<org.openqa.selenium.WebElement>
    Proxy handler for WebElement.
    • Constructor Detail

      • ComponentHandler

        public ComponentHandler​(org.openqa.selenium.support.pagefactory.ElementLocator locator)
        Creates a new component handler
        Parameters:
        locator - element locator for this component
    • Method Detail

      • getMessageContext

        public java.lang.String getMessageContext()
        Description copied from interface: LocatorHandler
        Retrieve the message context from this proxy locator.
        Specified by:
        getMessageContext in interface LocatorHandler<org.openqa.selenium.WebElement>
        Returns:
        message context
      • resultToList

        protected java.util.List<org.openqa.selenium.WebElement> resultToList​(org.openqa.selenium.WebElement result)
        Description copied from class: AbstractLocatorHandler
        Convert result to a list of selenium element.
        Specified by:
        resultToList in class AbstractLocatorHandler<org.openqa.selenium.WebElement>
        Parameters:
        result - found result
        Returns:
        list of selenium element
      • isStale

        protected boolean isStale()
        Description copied from class: AbstractLocatorHandler
        Get the stale status of the element.
        Specified by:
        isStale in class AbstractLocatorHandler<org.openqa.selenium.WebElement>
        Returns:
        true if element is stale, false otherwise
      • getInvocationTarget

        public org.openqa.selenium.WebElement getInvocationTarget​(java.lang.reflect.Method method)
        Description copied from interface: LocatorHandler
        Retrieve the invocation target of this proxy handler.
        Specified by:
        getInvocationTarget in interface LocatorHandler<org.openqa.selenium.WebElement>
        Parameters:
        method - method to invoke
        Returns:
        invocation target
      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Overrides:
        invoke in class AbstractLocatorHandler<org.openqa.selenium.WebElement>
        Throws:
        java.lang.Throwable