【问题标题】:Not able to use htmlunitdriver in Eclipse无法在 Eclipse 中使用 htmlunitdriver
【发布时间】:2016-04-27 07:09:35
【问题描述】:

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

我写了

WebDriver driver = new HtmlUnitDriver();

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

任何人都可以提供任何关于此的指针吗?

【问题讨论】:

  • 你使用的是 selenium 2.53 版本
  • 可能是你没有导入 WebDriver 和 HtmlUnitDriver。如果没有,那就去做吧。
  • 嗨,我使用的是 2.53; import 语句也会出错。

标签: java selenium-webdriver htmlunit-driver


【解决方案1】:

嗨,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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多