public class AjaxElementLocator extends DefaultElementLocator
isElementUsable(WebElement)
if this is important to you.
Because this class polls the interface on a regular basis, it is strongly recommended that users
avoid locating elements by XPath.Modifier and Type | Field and Description |
---|---|
protected int |
timeOutInSeconds |
Constructor and Description |
---|
AjaxElementLocator(Clock clock,
org.openqa.selenium.SearchContext searchContext,
Field field,
int timeOutInSeconds) |
AjaxElementLocator(org.openqa.selenium.SearchContext searchContext,
Field field,
int timeOutInSeconds)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
org.openqa.selenium.WebElement |
findElement()
Find the element.
|
List<org.openqa.selenium.WebElement> |
findElements()
Find the element list.
|
protected boolean |
isElementUsable(org.openqa.selenium.WebElement element)
By default, elements are considered "found" if they are in the DOM.
|
protected long |
sleepFor()
By default, we sleep for 250ms between polls.
|
public AjaxElementLocator(org.openqa.selenium.SearchContext searchContext, Field field, int timeOutInSeconds)
searchContext
- The context to use when finding the elementfield
- The field representing this elementtimeOutInSeconds
- How long to wait for the element to appear. Measured in seconds.public org.openqa.selenium.WebElement findElement()
findElement
in interface ElementLocator
findElement
in class DefaultElementLocator
public List<org.openqa.selenium.WebElement> findElements()
findElements
in interface ElementLocator
findElements
in class DefaultElementLocator
protected long sleepFor()
protected boolean isElementUsable(org.openqa.selenium.WebElement element)
Parameters:
element
- The element to useCopyright © 2014. All rights reserved.