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 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(SearchContext searchContext, Field field)
          Creates a new element locator.
 
Method Summary
 WebElement findElement()
          Find the element.
 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(SearchContext searchContext,
                             Field field)
Creates a new element locator.

Parameters:
searchContext - The context 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 List<WebElement> findElements()
Find the element list.

Specified by:
findElements in interface ElementLocator


Copyright © 2013. All Rights Reserved.