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

Chrome binary与ChromeDriver的关系及WDIO配置启动异常咨询

Chrome Binary与ChromeDriver的关系及WDIO配置问题解答

一、Chrome Binary与ChromeDriver的核心关系

  • Chrome Binary:是Chrome浏览器的核心可执行程序,路径为/Applications/Google Chrome.app/Contents/MacOS/Google Chrome,负责实际启动浏览器进程、渲染网页、处理用户交互等所有浏览器原生功能。
  • ChromeDriver:是一款独立的驱动程序,作为自动化测试框架(如WDIO)和Chrome浏览器之间的中间层。它的作用是接收测试框架的指令,转换为Chrome能识别的Chrome DevTools Protocol协议,再调用Chrome Binary执行对应操作,最后将执行结果返回给测试框架。
  • 关于调用逻辑:使用ChromeDriver确实等同于通过它间接调用Chrome Binary,但二者是完全独立的程序,不能混为一谈。

二、WDIO配置异常的原因与解决方法

你遇到的异常Chrome failed to start: exited abnormally.,根本原因是错误地将ChromeDriver的路径填入了goog:chromeOptions的binary参数——该参数的作用是指定Chrome Binary的路径,而非ChromeDriver的路径。

解决步骤:

  1. 将goog:chromeOptions下的binary参数值修改为正确的Chrome Binary路径:
    /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
  2. 确认ChromeDriver版本与Chrome浏览器版本完全匹配(大版本必须一致,例如Chrome 120.x对应ChromeDriver 120.x),版本不匹配也会导致浏览器启动失败。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.15 08:10:31