automated-tests - 如何使用谷歌浏览器在无头模式下运行 botium-cli
问题描述
如何使用 chrome 浏览器在无头模式下运行 botium-cli + botium-webdriver-connector?
该网页不适用于 phantomjs 浏览器
编辑:弗洛里安回答有效,我在 ubuntu 上运行 jenkins,还需要添加 --no-sanbox 和 --disable-dev-shm-usage 选项
我的最终配置
"WEBDRIVERIO_OPTIONS": {
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions": {
"args": [ "--headless", "--no-sandbox", "--disable--dev-shm-usage" ]
}
}
}
解决方案
在无头模式下使用 Chrome 可以使用 Botium 示例:https ://github.com/codeforequity-at/botium-connector-webdriverio/blob/master/samples/botbuilderwebchat/
在 botium.json 中,webdriver 选项应该设置如下:
"WEBDRIVERIO_OPTIONS": {
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions": {
"args": [ "--headless" ]
}
}
},
推荐阅读
- spring - 弹簧石英 | 玛丽亚数据库
- asp.net - 当页面参数超过页面计数时,Kentico Pager.PageCount 0
- c - 从 Linux 内核调用流量控制 (tc)
- c - 给出实数 x 和 y。我们需要判断坐标为(x;y)的点是否属于阴影区域
- mongodb - 实现mongo go驱动接口的正确方法
- eclipse - 自从我切换到 Logback 后,我的 Eclipse 控制台显示可怕的字符?(春季启动项目)
- javascript - 问题详细信息页面无法以角度工作
- reactjs - 在非反应原生组件中调度操作
- python - Django过滤器不查询数据
- php - 发送编码数组原因“您提交的 URI 包含不允许的字符”