org.openqa.selenium.support.pagefactory
Class DefaultElementLocator

java.lang.Object
  extended by 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.


Constructor Summary
DefaultElementLocator(WebDriver driver, Field field)
          Creates a new element locator.
 
Method Summary
 WebElement findElement()
          Find the element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultElementLocator

public DefaultElementLocator(WebDriver driver,
                             Field field)
Creates a new element locator.

Parameters:
driver - The driver to use when finding the element
field - The field on the Page Object that will hold the located value
Method Detail

findElement

public WebElement findElement()
Find the element.

Specified by:
findElement in interface ElementLocator


Copyright © 2011. All Rights Reserved.