无法使用 Firefox 35 的 JavascriptExecutor 突出显示 Selenium 中的 WebEle
Unable to highlight WebElement in Selenium using JavascriptExecutor for Firefox 35
在执行用于突出显示和重置 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 返回错误:
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}]
在火狐 35 更新后观察到此问题。有解决方法吗?
我在使用 Firefox 35 运行时也遇到了同样的问题。 我将其降级为对我有用的Firefox 33。(https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/mac/en-US/)
带有Firefox 33的Selenium服务器版本2.44.0解决了这个问题。
相关文章:
- 从桌面读取python文件时高亮显示代码
- 使用JS如何动态更改显示的html文件中的文本背景颜色
- 如何在生成下载文件时显示加载动画
- React重新渲染但未显示正确的组件
- Javascript:selenium Web驱动程序isDisplayed()不工作
- nodejs-expressjs上传图像并显示它们
- 使用JSP从服务器检索和显示图像
- 音频控件在mouseover上显示,在mouseout上淡出
- 让文本输入幻灯片显示输入时的新文本输入?然后向后滑动
- 使用电话间隙在Android应用程序中显示SQL Lite的数据
- 显示5秒后隐藏潜水
- 画廊图像未显示
- 不显示带有本地json文件数据的谷歌地图脚本
- 无法使用 Firefox 35 的 JavascriptExecutor 突出显示 Selenium 中的 WebEle
- 用Selenium突出显示WebElement并恢复原始边界
- 使用AOP突出显示selenium点击
- 如何使用Selenium IDE存储和键入显示文本的最后一个单词
- Selenium firefox 21在记录时无法进行log.debug,在javascript中登录时没有显示任何内容
- Selenium-WebDriver如何使用javascript和firefox浏览器突出显示元素
- 使用selenium突出显示焦点下的元素