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 or an element list on a page. This class is designed for use with the PageFactory and understands the annotations FindBy and CacheLookup.
  • Constructor Details

    • 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
    • DefaultElementLocator

      public DefaultElementLocator(SearchContext searchContext, AbstractAnnotations annotations)
      Use this constructor in order to process custom annotations.
      Parameters:
      searchContext - The context to use when finding the element
      annotations - AbstractAnnotations class implementation
  • Method Details