While executing the script used to highlight and reset a WebElement in selenium 2.43:
public void highlightElement(WebElement element) {
String originalStyle = element.getAttribute("style");
JavascriptExecutor js = (JavascriptExecutor) selenium;
js.executeScript("arguments[0].setAttribute('style', arguments[1]);",element,
"color: red; border: 5px solid red;");
try {
Thread.sleep(3000);
} catch (InterruptedException e) {}
js.executeScript("arguments[0].setAttribute('style', '" + originalStyle + "');", element);
}
Eclipse returns error:
org.openqa.selenium.WebDriverException: arguments[0] is undefined
Command duration or timeout: 74 milliseconds
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=WINDOWS, databaseEnabled=true, cssSelectorsEnabled=true, javascriptEnabled=true, acceptSslCerts=true, handlesAlerts=true, browserName=firefox, webStorageEnabled=true, nativeEvents=false, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=35.0}]
Observed the issue after Firefox 35 update. Is there a workaround?