Chrome Selenium::WebDriver::Error::WebDriverError:返回的有效负载中没有sessionId

gwo2fgha  于 2023-09-28  发布在  Go
关注(0)|答案(1)|浏览(162)

到目前为止,使用Rspec和Capybara的测试套件是成功的,但我突然得到了错误消息,没有编写任何新的规范:
`失败/错误:访问根路径

Webdrivers::VersionError:
   Unable to find latest point release version for 115.0.5790. You appear to be using a non-production version of Chrome. Please set `Webdrivers::Chromedriver.required_version = <desired driver version>` to a known chromedriver version: https://chromedriver.storage.googleapis.com/index.html`

所以我更新了selenium-webdriver到4.11.0(并删除了webdrivers gem)
但现在我得到了这个错误:
`失败/错误:访问根路径

Selenium::WebDriver::Error::WebDriverError:
   no sessionId in returned payload`

Ruby 3.2.2
`Capybara.register_driver:Chrome_headless do| app| options = Selenium::WebDriver::Chrome::Options.new

options.add_argument("--enable-features=NetworkService,NetworkServiceInProcess")
options.add_argument("--ignore-certificate-errors")
options.add_argument("--proxy-server=#{Billy.proxy.host}:#{Billy.proxy.port}")
options.add_argument("--disable-gpu") if Gem.win_platform?
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--window-size=1400,1400")
options.add_argument("--headless=new")
options.add_preference("intl.accept_languages", "en-US,en")
options.add_argument("--lang=en-US")
options.add_argument("--time-zone-for-testing=Europe/Paris")

Capybara::Selenium::Driver.new(
    app,
    browser: :chrome,
    options:,
    clear_local_storage: true,
    clear_session_storage: true
)


水豚.configure do| config| config.JavaScript_driver =:Chrome_headless end`

nhaq1z21

nhaq1z211#

根据该文档更新chromedriver:How to Install Chrome Driver on Mac
在此下载最新版本:Chrome for Testing availability

更新:只需从/usr/local/bin中删除chromedriver即可

相关问题