Web驱动程序curl异常 [英] Web Driver Curl Exception
问题描述
尝试使用Codeception Web Driver和Selenium通过验收测试来模拟ajax。我使用PhpBrowser,但是当我遇到的问题与Ajax我的朋友建议WebDriver。
启用它并下载selenium(并运行它)后,我得到以下错误。
[WebDriverCurlException]
http POST到http://127.0.0.1:4444/wd/ hub / session
with params:{desiredCapabilities:{browserName:googlechrome}}
无法连接到127.0.0.1端口4444:连接拒绝
我确定我是在4444端口运行selenium。
code> java -jar selenium-server.jar -port 4444
acceptance.suite.yml
class_name:AcceptanceTester
modules:
enabled:
- WebDriver
- REST
config:
WebDriver:
url:'http://life1605.dev'
浏览器:googlechrome
REST:
url:'http ://life1605.dev'
解决方案问题,具有完全相同的错误消息。由于一些奇怪的原因,它看起来像从命令行启动selenium服务器没有工作。
我的解决方案是通过Windows资源管理器手动打开selenium服务器,右键单击该文件,选择打开 - > Java Platform SE Binary。
花了我差不多3个小时才弄明白,所以我希望这能帮助别人。
Trying to use Codeception Web Driver and Selenium to emulate ajax through an acceptance test. I was using PhpBrowser but when I was having issues with Ajax my friend suggested WebDriver.
After enabling it and downloading the selenium (and running it) I get the following error.
[WebDriverCurlException] Curl error thrown for http POST to http://127.0.0.1:4444/wd/hub/session with params: {"desiredCapabilities":{"browserName":"googlechrome"}} Failed to connect to 127.0.0.1 port 4444: Connection Refused
I made sure I was running selenium on port 4444.
java -jar selenium-server.jar -port 4444
acceptance.suite.yml below
class_name: AcceptanceTester modules: enabled: - WebDriver - REST config: WebDriver: url: 'http://life1605.dev' browser: googlechrome REST: url: 'http://life1605.dev'
解决方案I had the same problem, with the exact same error message. For some strange reason, it looked like starting the selenium server from command line did not work.
My solution turned out to be manually opening the selenium server through Windows Explorer, right click on the file, choose Open with -> Java Platform SE Binary.
Took me almost 3 hours to figure it out, so I hope this helps somebody.
这篇关于Web驱动程序curl异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!