远程调试在Selenium chromedriver上运行的Internjs [英] Remote debugging Internjs that runs on selenium chromedriver
问题描述
我尝试远程调试Internjs运行的测试。
基本上它是由Selenium和Chromedriver运行的Chrome。
我将Chromedriver debuggerAddress选项设置为
debuggerAddress:'127.0.0.1:8765'
现在,当我运行测试时,Selenium等待一段时间,然后失败并显示消息:
致命错误
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}}}]未知错误:无法连接到chrome 127.0.0.1:8765
chrome无法访问
(驱动程序信息:chromedriver = 2.12.301326(093c7e07b4a916b690e784b0374c7f618f1ea4be),platform = Mac OS X 10.10.1 x86_64)(警告:服务器没有提供任何堆栈跟踪信息)
命令持续时间或超时值:60.64秒
我不知道我必须做什么才能让chrome w
我尝试过:
./ chromedriver_2.11 --port = 8765
运行chrome - remote-debugging-端口= 8765
但我没有其他想法如何启动chrome调试服务器。
我尝试过的有用链接不适合我: href =https://developer.chrome.com/devtools/docs/debugger-protocol =nofollow>远程调试协议
更新1 强制Chromedriver使用Chrome实例进行远程调试
运行一个新的Chrome实例,如 Mozilla文章
a>/ 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')
在实习生集中
intern.capabilities = {
'selenium-version':'2.44.0'
,'chromeOptions':{
debuggerAddress:'127.0.0.1:9222'
}
};
现在,当您运行Intern测试时,Intern会使用您之前打开的Chrome实例。现在你可以打开
localhost:9222
,你会发现你可以调试那个测试运行的选项卡。但是对于我来说,我只能看到那个远程选项卡,但点击它却什么都不做。
我也试过Firefox WebIDE。我试图连接到
localhost:9222
,它开始加载,并在一段时间后说它无法连接。解决方案今天晚上我尝试了一些类似的东西,但没有使用框架。我打开了一个webdriver会话&增加了远程调试功能。
似乎无法运行webdriver会话&同时进行远程调试。我询问了一些谷歌的人员来验证,但还没有收到答案。I try to remotely debug tests run by Internjs. Basically it is a Chrome that is run by Selenium and Chromedriver.
I set up Chromedriver debuggerAddress option as
debuggerAddress: '127.0.0.1:8765'
Now when I run tests Selenium waits some time and than fails with message:
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
I'm not sure what I have to do so that chrome would connect to server.
I did try:
- Running chromedriver on that port
./chromedriver_2.11 --port=8765
- Running chrome with
--remote-debugging-port=8765
But I have no other ideas how to start a chrome debug server.
Useful links that I did try that that did not work for me:
- Remote debugging protocol
- Remotely debugging Chrome Desktop
- Chromedriver Capabilities (aka ChromeOptions)
Update 1 Forcing Chromedriver to use a Chrome instance with remote debugging on
Run a new Chrome instance as in Mozilla article
/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')
In intern set
intern.capabilities = {
'selenium-version': '2.44.0'
, 'chromeOptions': {
debuggerAddress: '127.0.0.1:9222'
}
};
Now when you run Intern tests Intern will use your previously open Chrome instance. Now you can open localhost:9222
and you'll see that you can debug that tab in which tests run. However for me I'm just able to see that remote tab, but clicking on it does nothing.
I also tried Firefox WebIDE. I tried to connect to localhost:9222
, it starts to load and after some time it says that it can't connect.
I tried something similar this evening, without using a framework. I opened a webdriver session & added the remote debugger capabilities. It seems that it is not possible to run a webdriver session & remote debug at the same time. I asked some Google guys to verify that, but haven't received an answer yet.
这篇关于远程调试在Selenium chromedriver上运行的Internjs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!