selenium - 使用 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)
解决方案
我看到你的平台是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");
推荐阅读
- excel - 如何修改通过引用传递数组的类的公共数据成员?
- javascript - 在 Electron IPC 中传递对象会产生旧的对象版本
- c# - 如何在 C# 中按国家/地区获取语言
- excel - 如何使用 powershell 修改 Excel COM 中的对象?
- html - 调整浏览器大小时,如何在元素被另一个元素部分覆盖时使元素滚动?(CSS)
- javascript - 整理列表中的重复号码
- java - 如何使用 Maven 配置在 jOOQ 中使用自定义转换器?
- excel - 维护图表中的系列格式:MDX 图例更改的 VBA 事件
- python-3.x - 在 Python Cartopy 地图中突出显示地点
- nestjs - 如何在 NestJS 中发布到 Kafka 客户端?