Headless chrome: chrome not reachable

懵懂的女人 提交于 2021-01-27 21:10:24

问题


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/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'

The configuration is as shown below.

 capabilities: {
    'browserName': 'chrome',
    'chromeOptions': {
      'args': ['headless', 'disable-gpu']
    }

Tests run fine when i run without the 'headless' args.


回答1:


Update capabilities as it shows in the official manual:

capabilities: {
  browserName: 'chrome',

  chromeOptions: {
     args: [ "--headless", "--disable-gpu"]
   }
}

You could take a look at Using headless Chrome section



来源:https://stackoverflow.com/questions/45170002/headless-chrome-chrome-not-reachable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!