我在自动化 Web 特定测试用例时使用以下技术堆栈:
1. WebDriverIO for web automation
2. Travis as a CI tool
3. I am using `selenium-standalone` as a `service` - This is webdriverIO specific thing
travis.yml
文件如下所示:
language: node_js
node_js:
- '18.16.0'
dist: jammy
addons:
chrome: stable
before_install:
- # start your web application and listen on `localhost`
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
install:
- npm install
script:
- npm run generic
- npm run login
- npm run signup
当我从列出的测试套件中运行任何测试时,我遇到了以下错误:
Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: session not created: This version of ChromeDriver only supports Chrome version 117
[0-0] Current browser version is 116.0.5845.187 with binary path /opt/google/chrome/chrome
有什么办法可以不再遇到这个问题吗?谢谢!
我刚刚在 Heroku CI 上遇到了类似的问题,最终摆脱了 chromedriver 等构建包 - 以及任何保存 Chrome 路径的环境变量 - 然后只依靠新的 Selenium Manager 来处理自动检索正确版本的 chromedriver。