org.openqa.selenium.support.pagefactory
Class DefaultElementLocator
java.lang.Object
org.openqa.selenium.support.pagefactory.DefaultElementLocator
- All Implemented Interfaces:
- ElementLocator
- Direct Known Subclasses:
- AjaxElementLocator
public class DefaultElementLocator
- extends Object
- implements ElementLocator
The default element locator, which will lazily locate an element on a page.
This class is designed for use with the PageFactory
and understands
the annotations FindBy
and CacheLookup
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultElementLocator
public DefaultElementLocator(WebDriver driver,
Field field)
- Creates a new element locator.
- Parameters:
driver
- The driver to use when finding the elementfield
- The field on the Page Object that will hold the located value
findElement
public WebElement findElement()
- Find the element.
- Specified by:
findElement
in interface ElementLocator
Copyright © 2011. All Rights Reserved.