WebDriverIO/Selenium:无法启动 chromedriver 并出现错误,期望 Chrome 版本 90

WebDriverIO/Selenium: unable to start chromedriver with error expecting Chrome version 90

我无法启动 chromedriver 会话,出现以下错误:

[0-0] 2021-04-14T02:07:34.751Z DEBUG webdriver: request failed due to status 33
[0-0] 2021-04-14T02:07:34.751Z ERROR webdriver: Request failed with status 500 due to session not created: session not created: This version of ChromeDriver only supports Chrome version 90
Current browser version is 89.0.4389.114 with binary path /usr/bin/google-chrome
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'andisan-GL62M-7RDX', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-70-generic', java.version: '1.8.0_191'
Driver info: driver.version: unknown
remote stacktrace: #0 0x5646652bde89 <unknown>

我正在使用 WebDriverIO 6 和 chromedriver 包版本 89.0.0

...
    "@wdio/selenium-standalone-service": "^6.11.0",
    "chromedriver": "^89.0.0",
    "webdriverio": "^6.11.0"
...

据我所知Chrome 90 仍处于测试阶段,因此该错误消息可能具有误导性。关于为什么会发生这种情况以及如何解决的任何线索?

这似乎是 standalone-service 包的暂时性问题,它下载了错误的驱动程序版本。因此,要解决该问题,您只需设置一个应与您的浏览器版本一致的特定驱动程序版本(在您的情况下为 89.0.4389.114)。

wdio.conf.js文件中

export.config = {
    // ...
    services: [
        ['selenium-standalone', { drivers: { chrome: '89.0.4389.114' } }]
    ],
    // ...
};