我正在使用 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 )还是默认情况下它已经在运行而我只是没有正确连接到它?
最佳答案
正如实习生的文档所说
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
关于selenium - 如何在 CircleCI 上连接到本地 Selenium,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32425615/