I have a very simple Selenium/Ruby script, with the following key line excerpts:
#!/usr/bin/env ruby ... require 'selenium-webdriver' ... options = Selenium::WebDriver::Chrome::Options.new ... driver = Selenium::WebDriver.for :chrome, options: options ... driver.quit
Quite simply, it just uses the operating system’s (Ubuntu Linux) default offerings for Chrome and Chromedriver.
Every now and then, the Chrome automatically updates, and the Chromedriver does not, causing the script to start failing when run:
This version of ChromeDriver only supports Chrome version XX Current browser version is YY with binary path /usr/bin/chromium-browser
It is trivial for me to manually update Chromedriver each time, but it is annoying.
What is the best practice way to automagically keep Chromedriver updated to match Chrome?
Generally in Python we use
auto installer please see here, which is basically that auto install
chromdriver against appropriate chrome browser version. We have the same functionality in
Java-Selenium bindings as well using
Since you are asking for solely in
ruby-Selenium bindings, I could find one Github repo, Please see here.
Run Selenium tests more easily with automatic installation and updates for all supported webdrivers.
Windows Subsystem for Linux (WSL) v1 and
v2. And do see the browser and OS specific notes at the bottom.
In your Gemfile:
gem 'webdrivers', '~> 4.0', require: false
In your project:
The drivers will now be automatically downloaded or updated when you launch a browser through Selenium.
Answered By – cruisepandey
This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0