Class InjectionElementLocator

  • All Implemented Interfaces:

    public class InjectionElementLocator
    extends Object
    implements, FluentLabelProvider
    The injection 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 Detail

      • InjectionElementLocator

        public InjectionElementLocator​(org.openqa.selenium.SearchContext searchContext,
                                       InjectionAnnotations annotations,
                                       boolean isFirst)
        Use this constructor in order to process custom annotaions.
        searchContext - The context to use when finding the element
        annotations - InjectionAnnotations class implementation
        isFirst - Is this locator used to retrieve list or single element.
    • Method Detail

      • findElement

        public org.openqa.selenium.WebElement findElement()
        Find the element.
        Specified by:
        findElement in interface
        then found element
      • findElements

        public List<org.openqa.selenium.WebElement> findElements()
        Find the element list.
        Specified by:
        findElements in interface
        list of found elements