Class AppiumFieldDecorator

  • All Implemented Interfaces:
    org.openqa.selenium.support.pagefactory.FieldDecorator

    public class AppiumFieldDecorator
    extends java.lang.Object
    implements org.openqa.selenium.support.pagefactory.FieldDecorator
    Default decorator for use with PageFactory. Will decorate 1) all of the WebElement fields and 2) List of WebElement that have @AndroidFindBy, @AndroidFindBys, or @iOSFindBy/@iOSFindBys annotation with a proxy that locates the elements using the passed in ElementLocatorFactory. Please pay attention: fields of WebElement or RemoteWebElement to use with this decorator
    • Constructor Summary

      Constructors 
      Constructor Description
      AppiumFieldDecorator​(org.openqa.selenium.SearchContext context)  
      AppiumFieldDecorator​(org.openqa.selenium.SearchContext context, java.time.Duration duration)
      Creates field decorator based on SearchContext and timeout duration.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object decorate​(java.lang.ClassLoader ignored, java.lang.reflect.Field field)
      Decorated page object field.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_WAITING_TIMEOUT

        public static final java.time.Duration DEFAULT_WAITING_TIMEOUT
    • Constructor Detail

      • AppiumFieldDecorator

        public AppiumFieldDecorator​(org.openqa.selenium.SearchContext context,
                                    java.time.Duration duration)
        Creates field decorator based on SearchContext and timeout duration.
        Parameters:
        context - is an instance of SearchContext It may be the instance of WebDriver or WebElement or Widget or some other user's extension/implementation.
        duration - is a desired duration of the waiting for an element presence.
      • AppiumFieldDecorator

        public AppiumFieldDecorator​(org.openqa.selenium.SearchContext context)
    • Method Detail

      • decorate

        public java.lang.Object decorate​(java.lang.ClassLoader ignored,
                                         java.lang.reflect.Field field)
        Decorated page object field.
        Specified by:
        decorate in interface org.openqa.selenium.support.pagefactory.FieldDecorator
        Parameters:
        ignored - class loader is ignored by current implementation
        field - is Field of page object which is supposed to be decorated.
        Returns:
        a field value or null.