无法连接到 chromedriver http://127.0.0.1:46050 (Selenium::WebDriver::Error::WebDriverError) [英] unable to connect to chromedriver http://127.0.0.1:46050 (Selenium::WebDriver::Error::WebDriverError)

查看:35
本文介绍了无法连接到 chromedriver http://127.0.0.1:46050 (Selenium::WebDriver::Error::WebDriverError)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行黄瓜测试时收到此错误:

I get this error when I run my cucumber tests:

"*无法启动或连接到 Chrome.请检查 ChromeDriver 是否是最新的.在以下位置使用 Chrome 二进制文件:/opt/google/chrome/google-chrome (Selenium::WebDriver::错误::未知错误)*"

我下载了 chromdriver,解压缩,将其复制到路径 (/opt/google/chrome/google-chrome) 并 sudo chmod +x/opt/google/chrome/google-chrome.

I downloaded the chromdriver, unzip it, copy it to the path (/opt/google/chrome/google-chrome ) and sudo chmod +x /opt/google/chrome/google-chrome.

哪个 google-chrome :/usr/bin/google-chrome

which google-chrome : /usr/bin/google-chrome

哪个chromedriver:/usr/share/ruby-rvm/gems/ruby-1.9.2-p318/bin/chromedriver

which chromedriver : /usr/share/ruby-rvm/gems/ruby-1.9.2-p318/bin/chromedriver

水豚 (1.1.2)

黄瓜 (0.9.4)

黄瓜导轨 (0.3.2)

cucumber-rails (0.3.2)

selenium-webdriver (2.20.0)

selenium-webdriver (2.20.0)

我搜索了我的错误,但没有一个答案对我有用!当我运行测试时,我没有看到 chrome 启动!

I searched my error but none of the answers worked for me! When I run my test I do not see chrome starts!

我真的不知道怎么了!我尝试了两种不同版本的 chromedriver!

I really dont know what is wrong! I tried two different versions of chromedriver!

Jenkins 应该在 CI 中运行/执行我的测试.测试在您运行时有效,但在 Jenkins 运行时无效?我可以由另一个用户运行它们,然后我安装了 jenkins,我得到了这个错误.当我在终端上运行我的测试时,我也遇到了同样的错误.你读过 https://wiki.jenkins-ci.org/display/JENKINS/My+software+builds+on+my+computer+but+not+on+詹金斯 ?我在这里找不到很多关于我的问题的信息.xvfb:我在 jenkins 中安装了插件,但是在构建环境中,如果我单击在构建之前运行 xvfb 并在之后将其关闭",我会收到此错误:FATAL: null java.lang.NullPointerException"

Jenkins should run/executes my tests in CI.The tests work when you run them but not when Jenkins runs them? I could run them by another user and then I installed jenkins and I get this error. I get the same error when I run my tests in terminal at terminal as well.Did you read https://wiki.jenkins-ci.org/display/JENKINS/My+software+builds+on+my+computer+but+not+on+Jenkins ? I couldnt find much about my problem here. xvfb: I installed the plugin in the jenkins but in the build environment if I click "run xvfb before the build and shut it down after", I get this error: "FATAL: null java.lang.NullPointerException"

推荐答案

请提供更多细节.这个问题与詹金斯有什么关系?詹金斯正在执行测试吗?测试在您运行时有效,但在 Jenkins 运行时无效?你不会大声说出来,但我会假设它是因为人们通常需要帮助.

Please provide more details. How does this question relate to Jenkins? Is Jenkins executing the tests? The tests work when you run them but not when Jenkins runs them? You do not go so far as to say that out loud, but I will assume it because it is what people usually need help with.

你读过 https://wiki.jenkins-ci.org/display/JENKINS/My+software+builds+on+my+computer+but+not+on+Jenkins ?

如果您在 Jenkins 作业中执行 Chrome,是否有类似 https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Pluginhttps://wiki.jenkins-ci.org/display/JENKINS/Xvnc+Plugin 安装了吗?

If you are executing Chrome inside a Jenkins job, do you have something like https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin or https://wiki.jenkins-ci.org/display/JENKINS/Xvnc+Plugin installed?

这篇关于无法连接到 chromedriver http://127.0.0.1:46050 (Selenium::WebDriver::Error::WebDriverError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆