Can someone please help!
How can I highlight all web elements in following class during test execution in WebDriver? With Selenium RC, it was quite straight forward
I use below code for highlighting in my webdriver java code using javascript executer:
//I make a call below function "flash"
public static void flash(WebElement element, WebDriver driver) {
JavascriptExecutor js = ((JavascriptExecutor) driver);
String bgcolor = element.getCssValue("backgroundColor");
for (int i = 0; i < 3; i++) {
changeColor("rgb(0,200,0)", element, js);
changeColor(bgcolor, element, js);
}
}
public static void changeColor(String color, WebElement element, JavascriptExecutor js) {
js.executeScript("arguments[0].style.backgroundColor = '"+color+"'", element);
try {
Thread.sleep(20);
} catch (InterruptedException e) {
}
}
Hope that helped :)