[英]Unable to highlight WebElement in Selenium using JavascriptExecutor for Firefox 35
While executing the script used to highlight and reset a WebElement in selenium 2.43: 在执行用于突出显示和重置Selenium 2.43中的WebElement的脚本时:
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: 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}]
Observed the issue after Firefox 35 update. Firefox 35更新后观察到此问题。 Is there a workaround? 有解决方法吗?
I also faced the same issue when running with firefox 35. I downgraded this to firefox 33, which worked for me.( https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/mac/en-US/ ) 在使用firefox 35运行时,我也面临相同的问题。我将其降级为适用于我的firefox33。( https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/mac/en -美国/ )
Selenium server version 2.44.0 with firefox 33 resolved this issue. Selenium服务器版本2.44.0与firefox 33解决了此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.