public abstract class BaseElementLocator<T> extends Object implements VaniElementLocator<T>
| Modifier and Type | Field and Description |
|---|---|
protected org.openqa.selenium.By |
by |
protected T |
cachedElement |
protected List<T> |
cachedElementList |
protected FieldTypeInfo |
fieldTypeInfo |
protected org.apache.commons.logging.Log |
logger |
protected VaniReflectionUtil |
reflectionUtil |
protected org.openqa.selenium.SearchContext |
searchContext |
protected boolean |
shouldCache |
protected VaniContext |
vaniContext |
protected WaitUtil |
waitUtil |
| Constructor and Description |
|---|
BaseElementLocator(org.openqa.selenium.SearchContext searchContext,
org.openqa.selenium.By by,
boolean shouldCache,
FieldTypeInfo fieldTypeInfo,
VaniContext vaniContext)
Creates a new element locator.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
executeContentWait()
This method will execute configured content waits.
|
abstract T |
findElement()
This method will look only for one match and return it.
|
abstract List<T> |
findElements()
This method will look for multiple matches and returns it as a list.
|
protected org.openqa.selenium.SearchContext |
getRootElement() |
protected org.openqa.selenium.WebDriver |
getWebDriver()
This method tries to find the corresponding
WebDriver instance. |
protected boolean |
mustRelocateCachedElements()
This method will check whether
invalidated-flag is set on
corresponding bean instance. |
protected final org.apache.commons.logging.Log logger
protected final org.openqa.selenium.SearchContext searchContext
protected final boolean shouldCache
protected final org.openqa.selenium.By by
protected T cachedElement
protected FieldTypeInfo fieldTypeInfo
protected VaniContext vaniContext
protected WaitUtil waitUtil
protected VaniReflectionUtil reflectionUtil
public BaseElementLocator(org.openqa.selenium.SearchContext searchContext,
org.openqa.selenium.By by,
boolean shouldCache,
FieldTypeInfo fieldTypeInfo,
VaniContext vaniContext)
searchContext - The context to use when finding the elementby - shouldCache - public abstract T findElement()
VaniElementLocatorfindElement in interface VaniElementLocator<T>public abstract List<T> findElements()
VaniElementLocatorfindElements in interface VaniElementLocator<T>protected void executeContentWait()
ContentWait,
AjaxWaitprotected org.openqa.selenium.SearchContext getRootElement()
protected org.openqa.selenium.WebDriver getWebDriver()
WebDriver instance.
If searchContext is a WebDriver instance, it will be
returned. If not it will check whether searchContext is an
instance of RemoteWebElement and use
RemoteWebElement.getWrappedDriver() to get it.
WebDriver instance if availabel or
NULLprotected boolean mustRelocateCachedElements()
invalidated-flag is set on
corresponding bean instance.invalidated or false if bean instance is not a
RegionObject or marked as invalidatedCopyright © 2016. All rights reserved.