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?