public class DefaultElementLocator extends Object implements ElementLocator
PageFactory and understands the
annotations FindBy and CacheLookup.| 构造器和说明 |
|---|
DefaultElementLocator(SearchContext searchContext,
AbstractAnnotations annotations)
Use this constructor in order to process custom annotaions.
|
DefaultElementLocator(SearchContext searchContext,
Field field)
Creates a new element locator.
|
| 限定符和类型 | 方法和说明 |
|---|---|
WebElement |
findElement()
Find the element.
|
List<WebElement> |
findElements()
Find the element list.
|
String |
toString() |
public DefaultElementLocator(SearchContext searchContext, Field field)
searchContext - The context to use when finding the elementfield - The field on the Page Object that will hold the located valuepublic DefaultElementLocator(SearchContext searchContext, AbstractAnnotations annotations)
searchContext - The context to use when finding the elementannotations - AbstractAnnotations class implementationpublic WebElement findElement()
findElement 在接口中 ElementLocatorpublic List<WebElement> findElements()
findElements 在接口中 ElementLocator