Web驱动程序卷曲异常

Dyl*_*uth 9 testing selenium curl webdriver selenium-webdriver

尝试使用Codeception Web Driver和Selenium通过验收测试来模拟ajax.我正在使用PhpBrowser,但当我遇到Ajax问题时,我的朋友建议使用WebDriver.

启用它并下载selenium(并运行它)后,我收到以下错误.

[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
Run Code Online (Sandbox Code Playgroud)

我确定我在4444端口运行selenium.

 java -jar selenium-server.jar -port 4444
Run Code Online (Sandbox Code Playgroud)

acceptance.suite.yml如下

 class_name: AcceptanceTester
 modules:
     enabled:
         - WebDriver
         - REST
     config:
         WebDriver:
             url: 'http://life1605.dev'
             browser: googlechrome
         REST:
             url: 'http://life1605.dev'
Run Code Online (Sandbox Code Playgroud)

sun*_*mad 3

我遇到了同样的问题,具有完全相同的错误消息。由于某些奇怪的原因,看起来从命令行启动 selenium 服务器不起作用。

我的解决方案是通过 Windows 资源管理器手动打开 selenium 服务器,右键单击该文件,选择“打开方式”->“Java Platform SE Binary”。

我花了将近3个小时才弄清楚,所以我希望这对大家有所帮助。