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 java.lang.Object
implements ElementLocator

The default element locator, which will lazily locate an element or an element list on a page. This class is designed for use with the PageFactory and understands the annotations FindBy and CacheLookup.


Constructor Summary
DefaultElementLocator(WebDriver driver, java.lang.reflect.Field field)
          Creates a new element locator.
 
Method Summary
 WebElement findElement()
          Find the element.
 java.util.List<WebElement> findElements()
          Find the element list.
 
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,
                             java.lang.reflect.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

findElements

public java.util.List<WebElement> findElements()
Find the element list.

Specified by:
findElements in interface ElementLocator


Copyright © 2011. All Rights Reserved.