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

标签 selenium polymer ubuntu-16.04 htmlunit-driver wct

当我们使用 XVFB 加载 WCT 测试时,我在 ubuntu 上收到此错误。第一次测试顺利进行,但是当我们第二次运行时它失败了。 看起来缺少 HTMLunit 驱动程序。我尝试安装单元驱动程序但无法修复。

xvfb-run wct --skip-selenium-install enter image description here

最佳答案

我做了以下三件事来使其正常工作。它们可能不是完美的解决方案,因为它有点hacky。

  1. 下载 https://selenium-release.storage.googleapis.com/2.52/selenium-server-standalone-2.52.0.jar并将其复制到/usr/local/lib/node_modules/web-component-tester/node_modules/selenium-standalone/.selenium/selenium-server/2.52.0-server.jar (您可能需要更改路径以适合您的服务器)。

  2. 修改/usr/local/lib/node_modules/web-component-tester/node_modules/selenium-standalone/lib/default-config.js 将 selenium 独立服务器版本从 2.53.1 更改为 2.52.0 (这将解决 HtmlUnitDriver 未注册问题)

  3. 修改/usr/local/lib/node_modules/web-component-tester/node_modules/selenium-standalone/lib/check-started.js 以更改“var maxRetries = 60 * 1000/retryInterval;”为“var maxRetries = 600 * 1000/retryInterval;” (这将解决超时问题)

完成上述 hack 后,您可以运行 wct 或 xvfb-run wct。只需稍等一下,您就会看到测试结果。

关于selenium - Polymer Webcomponent Tester (WCT) XVFB 无法连接到 selenium,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39989175/

相关文章:

javascript - 无法让 Polymer 2 iron-flex-layout 工作

Redis 3 等待集群加入

mysql - sqoop 增量导入 :Import failed: --merge-key or --append is required when using --incremental lastmodified and the output directory exists

java - 如何通过使用 Selenium Grid 将文件从本地计算机传输到远程 Web 服务器来上传文件

javascript - 如何获取Polymer domHost属性?

c# - 将 chromedriver.exe 放在哪里以发布 Selenium WebDriver C#

polymer - 选择元素( polymer 1.0)

compiler-errors - 在64位计算机上编译静态32位Qt

python - 如何在Windows身份验证中传递URL中的特殊字符?

selenium - VS 2017 中的关联测试用例显示错误未连接到项目,但我是