java - 无法在 Eclipse 中使用 htmlunitsdriver

标签 java selenium-webdriver htmlunit-driver

我正在尝试在 Eclipse 中使用 HTMLunitdriver。

我写了

WebDriver driver = new HtmlUnitDriver();

所有 jar 文件都添加到构建路径中,但我收到错误“HTMLunit 驱动程序无法解析为类型”。

任何人都可以提供任何指示吗?

最佳答案

嗨,arjun,请降级到 2.52,它肯定会工作,我也已经弄明白为什么它不工作了

HtmlUnitDriver was a part of Selenium main distribution package prior to Selenium version
2.53. If you are using Selenium 2.52 or earlier you don't need to download and install 
HtmlUnitDriver, it is already there.

According to Selenium evolution strategy drivers should be separated from Selenium, 
and a driver release cycle should be synchronized with the target browser release cycle 
instead of Selenium release cycle. So this happened to HtmlUnitDriver too. It's not a part 
of the main Selenium distribution since version 2.53.

请通过链接获取更多信息 https://github.com/SeleniumHQ/htmlunit-driver 此外,如果您想继续使用 2.53 版本,请在此处下载 HtmlUnitDriver 表格 https://github.com/SeleniumHQ/htmlunit-driver/releases

关于java - 无法在 Eclipse 中使用 htmlunitsdriver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36882767/

相关文章:

java - 在 Eclipse 中传递系统命令和命令行参数

java - 如何向 javafx 添加勾号?

java - 字符串拆分,包括重音字符的单词

java - 错误:cannot find symbol -variable

java - 如何在 selenium webdriver 中使用 Canvas GoJS

java - htmlunit-driver - 如何模拟拖放?

java - 页面加载的默认 HtmlUnitDriver 超时是多少?

Selenium webdriver 获取元素的所有数据属性

java - Selenium2 配置文件接受不受信任的证书

selenium - Polymer Webcomponent Tester (WCT) XVFB 无法连接到 selenium