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,
SearchContext searchContext,
Field field,
int timeOutInSeconds) |
AjaxElementLocator(SearchContext searchContext,
Field field,
int timeOutInSeconds)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
WebElement |
findElement()
Find the element.
|
List<WebElement> |
findElements()
Find the element list.
|
protected boolean |
isElementUsable(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(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 AjaxElementLocator(Clock clock, SearchContext searchContext, Field field, int timeOutInSeconds)
public WebElement findElement()
findElement
in interface ElementLocator
findElement
in class DefaultElementLocator
public List<WebElement> findElements()
findElements
in interface ElementLocator
findElements
in class DefaultElementLocator
protected long sleepFor()
protected boolean isElementUsable(WebElement element)
Parameters:
element
- The element to useCopyright © 2013. All rights reserved.