Highlight elements with Selenium WebDriver
public void highlightElement(WebDriver driver, WebElement element) {
for (int i = 0; i < 2; i++) {
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].setAttribute('style', arguments[1]);",
element, "color: yellow; border: 2px solid yellow;");
js.executeScript("arguments[0].setAttribute('style', arguments[1]);",
element, "");
}
}
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment