During the execution of a script designed 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);
}
An error is thrown by Eclipse:
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}]
The issue started after updating to Firefox 35. Is there any workaround available?