Class DefaultFieldDecorator
java.lang.Object
org.openqa.selenium.support.pagefactory.DefaultFieldDecorator
- All Implemented Interfaces:
FieldDecorator
Default decorator for use with PageFactory. Will decorate 1) all the WebElement fields and 2)
List<WebElement> fields that have @FindBy, @FindBys, or
@FindAll annotation with a proxy that locates the elements using the passed in
ElementLocatorFactory.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondecorate
(ClassLoader loader, Field field) This method is called by PageFactory on all fields to decide how to decorate the field.protected boolean
isDecoratableList
(Field field) protected List<WebElement>
proxyForListLocator
(ClassLoader loader, ElementLocator locator) protected WebElement
proxyForLocator
(ClassLoader loader, ElementLocator locator)
-
Field Details
-
factory
-
-
Constructor Details
-
DefaultFieldDecorator
-
-
Method Details
-
decorate
Description copied from interface:FieldDecorator
This method is called by PageFactory on all fields to decide how to decorate the field.- Specified by:
decorate
in interfaceFieldDecorator
- Parameters:
loader
- The class loader that was used for the page objectfield
- The field that may be decorated.- Returns:
- Value to decorate the field with or null if it shouldn't be decorated. If non-null, must be assignable to the field.
-
isDecoratableList
-
proxyForLocator
-
proxyForListLocator
-