Class AppiumFieldDecorator

java.lang.Object
io.appium.java_client.pagefactory.AppiumFieldDecorator
All Implemented Interfaces:
org.openqa.selenium.support.pagefactory.FieldDecorator

public class AppiumFieldDecorator extends 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
  • Field Details

    • DEFAULT_WAITING_TIMEOUT

      public static final Duration DEFAULT_WAITING_TIMEOUT
  • Constructor Details

    • AppiumFieldDecorator

      public AppiumFieldDecorator(org.openqa.selenium.SearchContext context, 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 Details

    • decorate

      public Object decorate(ClassLoader ignored, 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.