相关疑难解决方法(0)

远程调试在selenium chromedriver上运行的Internjs

我尝试远程调试Internjs运行的测试.基本上它是由Selenium和Chromedriver运行的Chrome.

我将Chromedriver debuggerAddress选项设置为

debuggerAddress: '127.0.0.1:8765'
Run Code Online (Sandbox Code Playgroud)

现在,当我运行测试时,Selenium会等待一段时间而不是失败并显示消息:

FATAL ERROR
UnknownError: [POST http://localhost:4444/wd/hub/session / {"desiredCapabilities":{"browserName":"chrome","name":"tests/intern_local","idle-timeout":60,"selenium-version":"2.44.0","chromeOptions":{"debuggerAddress":"127.0.0.1:8765"}}}] unknown error: cannot connect to chrome at 127.0.0.1:8765
from chrome not reachable
  (Driver info: chromedriver=2.12.301326 (093c7e07b4a916b690e784b0374c7f618f1ea4be),platform=Mac OS X 10.10.1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.64 seconds
Run Code Online (Sandbox Code Playgroud)

我不知道我必须做什么才能将chrome连接到服务器.

我试过了:

  • 在该端口上运行chromedriver ./chromedriver_2.11 --port=8765
  • 运行铬与 --remote-debugging-port=8765

但我没有其他想法如何启动chrome调试服务器.

我尝试过的有用链接对我不起作用:

更新1强制Chromedriver使用带有远程调试的Chrome实例

像在Mozilla文章中一样运行新的Chrome实例

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --no-first-run --no-default-browser-check --user-data-dir=$(mktemp -d -t 'chrome-remote_data_dir')
Run Code Online (Sandbox Code Playgroud)

在实习生集

intern.capabilities = {
  'selenium-version': …
Run Code Online (Sandbox Code Playgroud)

selenium google-chrome remote-debugging selenium-chromedriver intern

5
推荐指数
1
解决办法
1903
查看次数