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