selenium - 如何在 CircleCI 上连接到本地 Selenium

标签 selenium intern circleci

我正在使用 Intern 运行一套功能测试并关注他们的 advice on connecting to local Selenium with Chromedriver .

在本地,一切正常,但在 CircleCI 上,我得到:
Error: [POST http://localhost:4444/wd/hub/session] connect ECONNREFUSED
这与在 CircleCI 上如何设置原生 Selenium 有关系吗?我是否必须在后台手动运行它( as described here )还是默认情况下它已经在运行而我只是没有正确连接到它?

最佳答案

  • 如果您想继续使用 NullTunnel

  • 正如实习生的文档所说

    If you are having trouble starting the server or getting Intern to communicate with it, verify the server is running correctly by going to http://localhost:4444/wd/hub/status. It should return a JSON response with a status field of 0.



    a) 你能看到预期的状态吗?

    b) 在运行 intern-runner 之前确保你自己已经启动了 Selenium .

    c) 有些人说他们需要使用 127.0.0.1 而不是 localhost,也许你也应该尝试一下?

    d) 一种罕见的情况,但也许您也可以检查一下,是您的 nodejs 版本。 csnover 曾经在这里提到过 nodejs 版本 https://github.com/theintern/intern-tutorial/issues/10#issuecomment-56390886
  • 我认为更好的方法是改用 SeleniumTunnel。那时您将不需要关心下载和运行 Selenium。
  • 关于selenium - 如何在 CircleCI 上连接到本地 Selenium,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32425615/

    相关文章:

    c# - 通过部分填充属性定位元素 Selenium/C#

    javascript - Selenium 测试 - 确定/取消弹出窗口立即消失

    CircleCI - 正则表达式过滤字符串内的匹配

    php - Laravel 5.2 artisan 优化 - php_strip_whitespace 无法打开流 : No child processes

    java - 如何在没有下载的exe文件的情况下使用Maven IEDriver库

    java - Selenium 等待 AJAX 编辑页面上的文本

    javascript - InternJs,如何在命令行上设置基本路径?

    javascript - 在 intern.js 中的测试中加载测试脚本

    javascript - 尝试使用 phantomjs 和 Selenium 运行单元测试时出错

    ruby-on-rails - react /巴别塔 : Components not rendering only on CircleCI