无头铬:铬无法触及 [英] Headless chrome: chrome not reachable
问题描述
我正在使用无头的Chrome来运行量角器测试.它运行了一段时间,但之后我出现了以下错误.
I am using Chrome headless to run the protractor test. It runs for a while but after that i get the following error.
[15:36:30] E/发射器-chrome无法访问(会话信息:headless chrome = 59.0.3071.115)(驱动程序信息:chromedriver = 2.30.477690(c53f4ad87510ee97b5c3425a14c0e79780cdf262),平台= Mac OS X 10.11.6x86_64)(警告:服务器未提供任何堆栈跟踪信息)命令持续时间或超时:5毫秒生成信息:版本:"3.4.0",修订版:未知",时间:未知"
[15:36:30] E/launcher - chrome not reachable (Session info: headless chrome=59.0.3071.115) (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.11.6 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 5 milliseconds Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
配置如下所示.
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': ['headless', 'disable-gpu']
}
当我没有'headless'参数时,测试运行正常.
Tests run fine when i run without the 'headless' args.
推荐答案
更新功能,如官方手册中所示:
Update capabilities as it shows in the official manual:
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: [ "--headless", "--disable-gpu"]
}
}
您可以看看使用无头Chrome 部分
这篇关于无头铬:铬无法触及的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!