public final class LocatorProxies extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
addProxyListener(Object proxy,
ProxyElementListener listener)
Add a proxy listener for this proxy.
|
static org.openqa.selenium.WebElement |
createWebElement(org.openqa.selenium.support.pagefactory.ElementLocator locator)
Create a WebElement proxy from an element locator.
|
static org.openqa.selenium.WebElement |
createWebElement(com.google.common.base.Supplier<org.openqa.selenium.WebElement> elementSupplier)
Create a WebElement proxy from an element supplier.
|
static org.openqa.selenium.WebElement |
createWebElement(org.openqa.selenium.WebElement element)
Create a WebElement proxy from an existing element.
|
static List<org.openqa.selenium.WebElement> |
createWebElementList(org.openqa.selenium.support.pagefactory.ElementLocator locator)
Create a list of WebElement proxies from a locator of element list.
|
static List<org.openqa.selenium.WebElement> |
createWebElementList(List<org.openqa.selenium.WebElement> elements)
Create a list of WebElement proxies from an existing element list.
|
static List<org.openqa.selenium.WebElement> |
createWebElementList(com.google.common.base.Supplier<List<org.openqa.selenium.WebElement>> elementsSupplier)
Create a list of WebElement proxies from a supplier of element list.
|
static org.openqa.selenium.WebElement |
first(List<org.openqa.selenium.WebElement> proxy)
Creates a proxy element matching the first element of the list.
|
static LocatorHandler |
getLocatorHandler(Object proxy)
Get the proxy locator handler.
|
static <T> T |
getLocatorResult(T proxy)
Get the underlying result of a proxy, through locator handler.
|
static String |
getMessageContext(Object proxy)
Get the message context of given proxy.
|
static org.openqa.selenium.WebElement |
index(List<org.openqa.selenium.WebElement> proxy,
int index)
Creates a proxy element matching the n-th element of the list.
|
static org.openqa.selenium.WebElement |
last(List<org.openqa.selenium.WebElement> proxy)
Creates a proxy element matching the last element of the list.
|
static boolean |
loaded(Object proxy)
Check if this proxy has loaded it's result.
|
static org.openqa.selenium.NoSuchElementException |
noSuchElement(Object proxy)
Build a NoSuchElementException using message provided by proxy.
|
static void |
now(Object proxy)
If result is not loaded, load result immediatly.
|
static boolean |
present(Object proxy)
Check if the proxy element is present.
|
static boolean |
removeProxyListener(Object proxy,
ProxyElementListener listener)
Removes a proxy element listener.
|
static void |
reset(Object proxy)
Reset the proxy locator handler.
|
static void |
setHooks(Object proxy,
HookChainBuilder hookChainBuilder,
List<HookDefinition<?>> hookDefinitions)
Apply this hook list.
|
public static org.openqa.selenium.NoSuchElementException noSuchElement(Object proxy)
proxy - proxypublic static String getMessageContext(Object proxy)
proxy - proxypublic static LocatorHandler getLocatorHandler(Object proxy)
proxy - proxy objectpublic static <T> T getLocatorResult(T proxy)
T - type of the resultproxy - proxy objectLocatorHandler.getLocatorResult()public static void reset(Object proxy)
proxy - proxy objectLocatorHandler.reset()public static boolean present(Object proxy)
proxy - proxy objectLocatorHandler.present()public static void now(Object proxy)
proxy - proxy objectLocatorHandler.now()public static boolean loaded(Object proxy)
proxy - proxy objectpublic static boolean addProxyListener(Object proxy, ProxyElementListener listener)
proxy - proxy objectlistener - listener to add, which will be notified when result is searched and foundpublic static boolean removeProxyListener(Object proxy, ProxyElementListener listener)
proxy - proxy objectlistener - listener to removepublic static org.openqa.selenium.WebElement createWebElement(org.openqa.selenium.WebElement element)
element - existing elementpublic static org.openqa.selenium.WebElement createWebElement(com.google.common.base.Supplier<org.openqa.selenium.WebElement> elementSupplier)
elementSupplier - element supplierpublic static org.openqa.selenium.WebElement createWebElement(org.openqa.selenium.support.pagefactory.ElementLocator locator)
locator - element locatorpublic static List<org.openqa.selenium.WebElement> createWebElementList(List<org.openqa.selenium.WebElement> elements)
elements - existing element listpublic static List<org.openqa.selenium.WebElement> createWebElementList(com.google.common.base.Supplier<List<org.openqa.selenium.WebElement>> elementsSupplier)
elementsSupplier - supplier of element listpublic static List<org.openqa.selenium.WebElement> createWebElementList(org.openqa.selenium.support.pagefactory.ElementLocator locator)
locator - locator of element listpublic static void setHooks(Object proxy, HookChainBuilder hookChainBuilder, List<HookDefinition<?>> hookDefinitions)
proxy - proxy objecthookChainBuilder - hook chain builderhookDefinitions - hook definitionspublic static org.openqa.selenium.WebElement first(List<org.openqa.selenium.WebElement> proxy)
proxy - list of elementpublic static org.openqa.selenium.WebElement last(List<org.openqa.selenium.WebElement> proxy)
proxy - list of elementpublic static org.openqa.selenium.WebElement index(List<org.openqa.selenium.WebElement> proxy, int index)
proxy - list of elementindex - index to matchCopyright © 2016 FluentLenium. All Rights Reserved.