Thursday, 3 October 2013

Highlight elements with Selenium WebDriver

public void highlightElement(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, “”);
}

No comments:

Post a Comment

Angular JS Protractor Installation process - Tutorial Part 1

                     Protractor, formally known as E2E testing framework, is an open source functional automation framework designed spe...