Modifier and Type | Field and Description |
---|---|
static int |
URLCHANGE_MAX_WAIT |
Constructor and Description |
---|
Locator() |
Modifier and Type | Method and Description |
---|---|
static org.openqa.selenium.WebElement |
findElement(org.openqa.selenium.By by) |
static org.openqa.selenium.WebElement |
findElementAndWaitUntilEnabled(org.openqa.selenium.By by)
Finds the first
WebElement using the given method, with the default timeout. |
static org.openqa.selenium.WebElement |
findElementAndWaitUntilEnabled(org.openqa.selenium.By by,
int findElementTimeout,
int waitUntilEnabledTimeout)
Finds the first
WebElement using the given method, with a findElementTimeout . |
static List<org.openqa.selenium.WebElement> |
findElementsWithTimeout(org.openqa.selenium.By by) |
static void |
findElementWaitUntilEnabledAndClick(org.openqa.selenium.By by)
Finds the first
WebElement using the given method, with the default timeout. |
static org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by)
Finds the first
WebElement using the given method, with a timeout. |
static org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by,
int timeout)
Finds the first
WebElement using the given method, with a timeout. |
static org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by,
int timeout,
org.openqa.selenium.WebElement parentElement)
Finds the first
WebElement using the given method, with a timeout. |
static org.openqa.selenium.WebElement |
findElementWithTimeout(org.openqa.selenium.By by,
org.openqa.selenium.WebElement parentElement)
Finds the first
WebElement using the given method, with a timeout. |
static void |
findElementWithTimeoutAndClick(org.openqa.selenium.By by)
Finds the first
WebElement using the given method, with a findElementTimeout . |
static org.openqa.selenium.WebElement |
findParentTag(org.openqa.selenium.WebElement elt,
String tagName)
Return parent element with given tag name.
|
static void |
waitForTextNotPresent(org.openqa.selenium.WebElement element,
String text)
Fluent wait for text to be not present in the given element.
|
static void |
waitForTextPresent(org.openqa.selenium.By locator,
String text)
Fluent wait for text to be present in the element retrieved with the given method.
|
static void |
waitForTextPresent(org.openqa.selenium.WebElement element,
String text)
Fluent wait for text to be present in the given element.
|
static void |
waitUntilElementEnabledAndClick(org.openqa.selenium.By by,
int findElementTimeout,
int waitUntilEnabledTimeout)
Finds the first
WebElement using the given method, with a findElementTimeout . |
static void |
waitUntilElementNotPresent(org.openqa.selenium.By locator)
Fluent wait for an element not to be present, checking every 100 ms.
|
static void |
waitUntilElementPresent(org.openqa.selenium.By locator)
Fluent wait for an element to be present, checking every 100 ms.
|
static void |
waitUntilEnabled(org.openqa.selenium.WebElement element)
Waits until an element is enabled, with a timeout.
|
static void |
waitUntilEnabled(org.openqa.selenium.WebElement element,
int timeout)
Waits until an element is enabled, with a timeout.
|
static void |
waitUntilGivenFunction(com.google.common.base.Function<org.openqa.selenium.WebDriver,Boolean> function)
Fluent wait on a the given function, checking every 100 ms.
|
static <K extends Throwable> |
waitUntilGivenFunctionIgnoreAll(com.google.common.base.Function<org.openqa.selenium.WebDriver,Boolean> function,
Class<? extends K>... ignoredExceptions)
Fluent wait on a the given function, checking every 100 ms.
|
static <K extends Throwable> |
waitUntilGivenFunctionIgnoring(com.google.common.base.Function<org.openqa.selenium.WebDriver,Boolean> function,
Class<? extends K> ignoredException)
Fluent wait on a the given function, checking every 100 ms.
|
static void |
waitUntilURLContains(String string)
Waits until the URL contains the string given in parameter, with a timeout.
|
static void |
waitUntilURLDifferentFrom(String url)
Waits until the URL is different from the one given in parameter, with a timeout.
|
static void |
waitUntilURLNotContain(String string)
Waits until the URL does not contain the string given in parameter, with a timeout.
|
public static int URLCHANGE_MAX_WAIT
public Locator()
public static org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
public static org.openqa.selenium.WebElement findElementAndWaitUntilEnabled(org.openqa.selenium.By by) throws org.openqa.selenium.NotFoundException
WebElement
using the given method, with the default timeout. Then waits until the element
is enabled, with the default timeout.by
- the locating mechanismorg.openqa.selenium.NotFoundException
- if the element is not found or not enabledpublic static org.openqa.selenium.WebElement findElementAndWaitUntilEnabled(org.openqa.selenium.By by, int findElementTimeout, int waitUntilEnabledTimeout) throws org.openqa.selenium.NotFoundException
WebElement
using the given method, with a findElementTimeout
. Then waits until
the element is enabled, with a waitUntilEnabledTimeout
.by
- the locating mechanismfindElementTimeout
- the find element timeout in millisecondswaitUntilEnabledTimeout
- the wait until enabled timeout in millisecondsorg.openqa.selenium.NotFoundException
- if the element is not found or not enabledpublic static List<org.openqa.selenium.WebElement> findElementsWithTimeout(org.openqa.selenium.By by) throws org.openqa.selenium.NoSuchElementException
org.openqa.selenium.NoSuchElementException
public static void findElementWaitUntilEnabledAndClick(org.openqa.selenium.By by) throws org.openqa.selenium.NotFoundException
WebElement
using the given method, with the default timeout. Then waits until the element
is enabled, with the default timeout. Then clicks on the element.by
- the locating mechanismorg.openqa.selenium.NotFoundException
- if the element is not found or not enabledpublic static org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by) throws org.openqa.selenium.NoSuchElementException
WebElement
using the given method, with a timeout.by
- the locating mechanismtimeout
- the timeout in millisecondsorg.openqa.selenium.NoSuchElementException
- when not foundpublic static org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by, int timeout) throws org.openqa.selenium.NoSuchElementException
WebElement
using the given method, with a timeout.by
- the locating mechanismtimeout
- the timeout in millisecondsorg.openqa.selenium.NoSuchElementException
- when not foundpublic static org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by, int timeout, org.openqa.selenium.WebElement parentElement) throws org.openqa.selenium.NoSuchElementException
WebElement
using the given method, with a timeout.by
- the locating mechanismtimeout
- the timeout in millisecondsparentElement
- find from the elementorg.openqa.selenium.NoSuchElementException
- when not foundpublic static org.openqa.selenium.WebElement findElementWithTimeout(org.openqa.selenium.By by, org.openqa.selenium.WebElement parentElement) throws org.openqa.selenium.NoSuchElementException
WebElement
using the given method, with a timeout.by
- the locating mechanismtimeout
- the timeout in millisecondsparentElement
- find from the elementorg.openqa.selenium.NoSuchElementException
- when not foundpublic static void waitForTextNotPresent(org.openqa.selenium.WebElement element, String text)
public static void waitForTextPresent(org.openqa.selenium.By locator, String text)
public static void waitForTextPresent(org.openqa.selenium.WebElement element, String text)
public static void waitUntilElementEnabledAndClick(org.openqa.selenium.By by, int findElementTimeout, int waitUntilEnabledTimeout) throws org.openqa.selenium.NotFoundException
WebElement
using the given method, with a findElementTimeout
. Then waits until
the element is enabled, with a waitUntilEnabledTimeout
. Then clicks on the element.by
- the locating mechanismfindElementTimeout
- the find element timeout in millisecondswaitUntilEnabledTimeout
- the wait until enabled timeout in millisecondsorg.openqa.selenium.NotFoundException
- if the element is not found or not enabledpublic static void findElementWithTimeoutAndClick(org.openqa.selenium.By by) throws org.openqa.selenium.NotFoundException
WebElement
using the given method, with a findElementTimeout
. Then clicks on the
element.by
- the locating mechanismorg.openqa.selenium.NotFoundException
- if the element is not found or not enabledpublic static void waitUntilElementNotPresent(org.openqa.selenium.By locator)
public static void waitUntilElementPresent(org.openqa.selenium.By locator)
public static void waitUntilEnabled(org.openqa.selenium.WebElement element) throws org.openqa.selenium.NotFoundException
element
- the elementorg.openqa.selenium.NotFoundException
public static void waitUntilEnabled(org.openqa.selenium.WebElement element, int timeout) throws org.openqa.selenium.NotFoundException
element
- the elementtimeout
- the timeout in millisecondsorg.openqa.selenium.NotFoundException
public static void waitUntilGivenFunction(com.google.common.base.Function<org.openqa.selenium.WebDriver,Boolean> function)
function
- public static <K extends Throwable> void waitUntilGivenFunctionIgnoreAll(com.google.common.base.Function<org.openqa.selenium.WebDriver,Boolean> function, Class<? extends K>... ignoredExceptions)
function
- ignoredExceptions
- the types of exceptions to ignore.public static <K extends Throwable> void waitUntilGivenFunctionIgnoring(com.google.common.base.Function<org.openqa.selenium.WebDriver,Boolean> function, Class<? extends K> ignoredException)
function
- ignoredException
- the type of exception to ignore.public static void waitUntilURLContains(String string)
string
- the string that is to be containedpublic static void waitUntilURLDifferentFrom(String url)
url
- the URL to compare topublic static void waitUntilURLNotContain(String string)
string
- the string that is not to be containedpublic static org.openqa.selenium.WebElement findParentTag(org.openqa.selenium.WebElement elt, String tagName)
Throws a NoSuchElementException
error if no element found.
Copyright © 2016 Nuxeo SA. All rights reserved.