You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WebDriverIO在Botium中使用时无法创建Chrome浏览器会话问题求助

Botium WebdriverIO会话创建失败故障排查方案
  • 确认selenium-standalone服务运行状态:启动服务后访问http://localhost:4444/wd/hub/status,确认服务正常响应无端口占用。
  • 修正配置参数位置:hostname、port、path属于WEBDRIVERIO_OPTIONS的顶层参数,不可放在capabilities字段内,之前配置不生效多为位置填写错误。
  • 适配W3C能力规范:Chrome相关非标准能力需添加goog:前缀,同时补充Chrome启动参数规避常见启动异常,正确配置参考如下:
"WEBDRIVERIO_OPTIONS": {
  "hostname": "localhost",
  "port": 4444,
  "path": "/wd/hub",
  "capabilities": {
    "browserName": "chrome",
    "goog:chromeOptions": {
      "args": ["--no-sandbox", "--disable-dev-shm-usage", "--disable-gpu"]
    }
  }
}
  • 核对版本兼容性:Chrome浏览器主版本号必须与ChromeDriver主版本号完全匹配,当前使用的ChromeDriver为92版本,需确认本地Chrome浏览器为92.x版本;同时确认selenium-standalone版本与Botium依赖的WebdriverIO版本适配。
  • 清理残留进程:执行测试前先杀掉所有残留的chromedriver、selenium进程,避免端口占用或会话冲突,重启selenium-standalone后再运行测试命令。
  • 可选轻量方案:如果不需要使用自建的selenium-standalone服务,可直接删除WEBDRIVERIO_OPTIONS中的hostname、port、path配置,WebdriverIO会自动管理ChromeDriver生命周期,无需额外启动selenium服务。

内容的提问来源于stack exchange,提问作者Kumar Punnana

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.06 05:57:03