Selenium::WebDriver::Error::SessionNotCreatedError: from action in github (in vscod works good)

Selenium::WebDriver::Error::SessionNotCreatedError: from action in github (in vscod works good)

2022-03-08 11:21:22 警告 Selenium [弃用] [:driver_path] Selenium::WebDriver::Chrome#driver_path= 已弃用。请改用 Selenium::WebDriver::Chrome::Service#driver_path=。

加载 spec_helper 时出错。 Failure/Error:浏览器=Capybara.current_session.driver.browser

Selenium::WebDriver::Error::SessionNotCreatedError: 未创建会话:此版本的 Chrome 驱动程序仅支持 Chrome 版本 99 当前浏览器版本为 98.0.4758.102,二进制路径为 /usr/bin/google-chrome

错误消息准确说明了您的问题所在 - 您正在使用 chromedriver v99.x 和 Chrome v98.x - 这是行不通的。与其尝试手动管理正在使用的 chromedriver 版本,不如使用 webdrivers gem 自动为您管理它。