If you have some tests that use ChromeDriver to run in a browser environment,
and you’re seeing errors like
This version of ChromeDriver only supports
Chrome version 114, and you’d rather do some useful work than waste time
fixing stuff that worked last week, here’s a quick fix that worked for me on
Linux. Something similar might work on Mac OS. I’ve no idea about Windows.
This all started when I had to make a video call on Slack. I avoid using the
as far as possible, but Slack video calls don’t work in Firefox (due to an
aggressive failure to be
arsed on the part of
Slack/Salesforce), so I use Chrome for the one time a week I need to do that.
Last week, Slack refused to work on the “too old” version of Chrome that I had
installed, so I had to update. Updating Chrome broke ChromeDriver, and I
couldn’t fix that without updating the
selenium-webdriver gem, and I couldn’t
update that without updating Ruby, and I couldn’t do that without updating the
Stripe gem, which isn’t trivial, and, well, I am in the process of doing all
these things, but I’m not there yet. In the meantime, this was all extremely
In an ideal world, I wouldn’t face problems with incompatibilities between
libraries, versions of Chrome, versions of Ruby, and Google changing how they
publish the location of the
executable. To be honest, in an
ideal world, I don’t think any of this stuff would exist. In this vale of
tears, however, it’s always more complicated.
The basic idea behind this solution is to download a matching pair of mutually compatible Chrome for Testing and ChromeDriver and to use these when running tests. This also means that if you have another version of Chrome installed, upgrades to that shouldn’t break the ChromeDriver integration in future.
Visit the Chrome for Testing page and download the stable
chromedriver-linux64.zippackages. You’ll have to copy and paste the URLs. I don’t know why they don’t make them links.
$ mkdir -p ~/.local/opt $ unzip -d ~/.local/opt chrome-linux64.zip
chromedriver-linux64.zipand copy the
chromedriverbinary into the same location as
$ unzip -j -d ~/.local/opt/chrome-linux64 chromedriver-linux64.zip
Add the chrome directory to your path:
$ export PATH="$HOME/.local/opt/chrome-linux64:$PATH"
You can test this:
$ which chrome /home/paul/.local/opt/chrome-linux64/chrome $ which chromedriver /home/paul/.local/opt/chrome-linux64/chromedriver
You might wish to add this to your path for all sessions, or just to add it when running tests. If you’re running tests from your editor, configure it appropriately. That’s up to you. I’ve added the
exportline to a file that I load into
source chromedriver.shwhen I need it.
This should work for a while, until the next time that someone changes something significant for no apparent good reason.