Package org.fluentlenium.core.inject
Class InjectionElementLocator
- java.lang.Object
-
- org.fluentlenium.core.inject.InjectionElementLocator
-
- All Implemented Interfaces:
FluentLabelProvider,org.openqa.selenium.support.pagefactory.ElementLocator
public class InjectionElementLocator extends java.lang.Object implements org.openqa.selenium.support.pagefactory.ElementLocator, 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 thePageFactoryand understands the annotationsFindByandCacheLookup.
-
-
Constructor Summary
Constructors Constructor Description InjectionElementLocator(org.openqa.selenium.SearchContext searchContext, InjectionAnnotations annotations, boolean isFirst)Use this constructor in order to process custom annotaions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.openqa.selenium.WebElementfindElement()Find the element.java.util.List<org.openqa.selenium.WebElement>findElements()Find the element list.java.lang.StringgetLabel()Get defined definition.java.lang.String[]getLabelHints()Get defined label hints.java.lang.StringtoString()
-
-
-
Constructor Detail
-
InjectionElementLocator
public InjectionElementLocator(org.openqa.selenium.SearchContext searchContext, InjectionAnnotations annotations, boolean isFirst)Use this constructor in order to process custom annotaions.- Parameters:
searchContext- The context to use when finding the elementannotations- InjectionAnnotations class implementationisFirst- Is this locator used to retrieve list or single element.
-
-
Method Detail
-
findElement
public org.openqa.selenium.WebElement findElement()
Find the element.- Specified by:
findElementin interfaceorg.openqa.selenium.support.pagefactory.ElementLocator- Returns:
- then found element
-
findElements
public java.util.List<org.openqa.selenium.WebElement> findElements()
Find the element list.- Specified by:
findElementsin interfaceorg.openqa.selenium.support.pagefactory.ElementLocator- Returns:
- list of found elements
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getLabel
public java.lang.String getLabel()
Description copied from interface:FluentLabelProviderGet defined definition.- Specified by:
getLabelin interfaceFluentLabelProvider- Returns:
- defined label
-
getLabelHints
public java.lang.String[] getLabelHints()
Description copied from interface:FluentLabelProviderGet defined label hints.- Specified by:
getLabelHintsin interfaceFluentLabelProvider- Returns:
- array of label hints
-
-