首页 > 解决方案 > 使用 Chrome 浏览器在 Selenium Grid 中执行测试脚本时出现“Chrome 无法访问”错误

问题描述

我正在使用 chrome 浏览器在 selenium Grid 中运行自动化测试脚本,但Chrome not reachable出现错误。

 cucumber.runtime.CucumberException:
 org.openqa.selenium.WebDriverException: 
 chrome not reachable
      (Session info: chrome=68.0.3440.84)
      (Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 3.10.0-957.1.3.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)

标签: seleniumselenium-webdriverselenium-grid

解决方案


我看到你的平台是Linux。如果尚未完成,您能否将以下功能与您现有的功能一起添加,并告诉我们。

ChromeOptions cOptions = new ChromeOptions();
//argument to switch off suid sandBox and no sandBox in Chrome 
chrome_options.add_argument("--no-sandbox");
chrome_options.add_argument("--disable-setuid-sandbox");

推荐阅读