public interface IRefreshable
According to a 'Recognition String', we can get a WebElement through Selenium. This WebElement represents a control on the web application, and it can be used to manipulate the control by Selenium. But sometimes, this WebElement will become stale (calling a javascript function on the same control) and cannot be used anymore. At this situation, the WebElement needs to be refreshed.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCssClass()
get the WebElement's CSS Class.
|
java.lang.String |
getId()
get the WebElement's ID.
|
java.lang.String[] |
getPossibleRecognitionStrings()
get the possible recognition strings, they will be tried one by one until
a valid WebElement is got. |
org.openqa.selenium.SearchContext |
getSearchContext()
get the SearchContext, used during refresh of WebElement.
If it is null, the search of WebElement will be processed through WebDriver, which means to search on the whole web page. |
java.lang.String |
getTagName()
get the WebElement's Tag Name.
|
org.openqa.selenium.WebElement |
getWebElement()
get the embedded WebElement object.
|
boolean |
refresh(boolean checkStale)
Refresh the embedded WebElement object.
|
void |
setWebElement(org.openqa.selenium.WebElement webelement)
set the embedded WebElement object.
|
java.lang.String getId()
java.lang.String getTagName()
java.lang.String getCssClass()
org.openqa.selenium.SearchContext getSearchContext()
java.lang.String[] getPossibleRecognitionStrings()
org.openqa.selenium.WebElement getWebElement()
void setWebElement(org.openqa.selenium.WebElement webelement)
boolean refresh(boolean checkStale)
checkStale
- boolean, if true then check if the element is stale or not before refresh;
ohterwise, then refresh the element directly.
The check will spend some time, if you don't want to waste time, use false.Copyright © SAS Institute. All Rights Reserved.