由于“无法连接到渲染器”错误,Selenium Webdriver测试无法在Chrome上无头运行

时间:2019-05-10 16:22:37

标签: google-chrome selenium-webdriver selenium-chromedriver google-chrome-headless

正在运行的Chrome版本:67.0.3396.79

Chromedriver版本:2.40.0(https://www.npmjs.com/package/chromedriver

在Chrome无头模式下运行Selenium Webdriver测试时,出现错误:

SessionNotCreatedError: session not created exception
     from disconnected: unable to connect to renderer
       (Session info: headless chrome=67.0.3396.79)
       (Driver info: chromedriver=2.40.565383 (76257d1ab79276b2d53ee976b2c3e3b9f335cde7),platform=Linux 3.13.0-74-generic x86_64)
         at Object.checkLegacyResponse (/home/jenkins/workspace/1-sunrise-e2e-tests-dev/node_modules/selenium-webdriver/lib/error.js:546:15)

1 个答案:

答案 0 :(得分:0)

天哪!看起来问题出在'--remote-debugging-port = 9222',我将其添加到无头Chrome选项中,将其删除并修复。