public class DefaultElementLocator extends java.lang.Object implements ElementLocator
PageFactory
and understands the
annotations FindBy
and CacheLookup
.Modifier and Type | Field and Description |
---|---|
private org.openqa.selenium.By |
by |
private org.openqa.selenium.WebElement |
cachedElement |
private java.util.List<org.openqa.selenium.WebElement> |
cachedElementList |
private org.openqa.selenium.SearchContext |
searchContext |
private boolean |
shouldCache |
Constructor and Description |
---|
DefaultElementLocator(org.openqa.selenium.SearchContext searchContext,
AbstractAnnotations annotations)
Use this constructor in order to process custom annotaions.
|
DefaultElementLocator(org.openqa.selenium.SearchContext searchContext,
java.lang.reflect.Field field)
Creates a new element locator.
|
Modifier and Type | Method and Description |
---|---|
org.openqa.selenium.WebElement |
findElement()
Find the element.
|
java.util.List<org.openqa.selenium.WebElement> |
findElements()
Find the element list.
|
java.lang.String |
toString() |
private final org.openqa.selenium.SearchContext searchContext
private final boolean shouldCache
private final org.openqa.selenium.By by
private org.openqa.selenium.WebElement cachedElement
private java.util.List<org.openqa.selenium.WebElement> cachedElementList
public DefaultElementLocator(org.openqa.selenium.SearchContext searchContext, java.lang.reflect.Field field)
searchContext
- The context to use when finding the elementfield
- The field on the Page Object that will hold the located valuepublic DefaultElementLocator(org.openqa.selenium.SearchContext searchContext, AbstractAnnotations annotations)
searchContext
- The context to use when finding the elementannotations
- AbstractAnnotations class implementationpublic org.openqa.selenium.WebElement findElement()
findElement
in interface ElementLocator
public java.util.List<org.openqa.selenium.WebElement> findElements()
findElements
in interface ElementLocator
public java.lang.String toString()
toString
in class java.lang.Object