Chromedriver version 114 trying to use current chrome browser (118) after macOS update to ventura (ruby/rails)

1.7k Views Asked by At

I recently updated my OS to ventura (right before it changed to sonoma) and since then I haven't been able to use rspec for any specs that use Capybara due to the following error:

Selenium::WebDriver::Error::SessionNotCreatedError:
  session not created: This version of ChromeDriver only supports Chrome version 114
  Current browser version is 118.0.5993.117 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

This was never an issue prior to the update. Our app is using Rails 6.0.6.1 and ruby 2.6.6p146

I'm pushing hard to get a ruby/rails upgrade but in the meantime I am not able to use the selenium-webdriver 4.11+ gem, we're currently stuck at 3.142.7, as a result we're stuck with a max chromedriver version of 114.0.5735.90

I've researched this extensively, my chromedriver is installed and configured properly, the issue is that it's trying to use my installed version of chrome, currently 118.0.5993.117 instead of the corresponding 114 version is should and previously did.

I know the solution is to upgrade the rails/ruby/gems, trust me i'm working on it, but as this is such a bespoke issue i haven't been able to find a solution anywhere, everything i find is from a few years ago and relates to chromedriver versions around the change from 114+ but after that selenium 4.11 negated this issue for most people.

I've tried everything I can think of, I know you can't rollback your version of chrome, and I thoroughly confirmed that chromedriver is working properly (and everything in the app, it's been working for years). I have not been able to find any way to specify the chrome browser version it should be using, selenium-webdriver and webdrivers gems should be handling this for me, and should not need any configuration.

I did try downloading my specific version of chrome here but this did not work, I think this might be the 114+ option that selenium 4.11+ is using and not available for <115

edit: I've tried updating my chromedriver version through brew, but I get the following error messsage:

Webdrivers::VersionError:
            Unable to find latest point release version for 118.0.5993. 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

Which as far as I know is the entire difference between pre and post selenium 4.11, the former looks to that index to find the right version (and won't find anything greater than 114), the latter gets the current release. If there's a way to tell below selenium 4.11 to use above chromedriver 114 please let me know, when i set the required version manually i get:

Webdrivers::NetworkError:
              Net::HTTPServerException: 404 "Not Found" with https://chromedriver.storage.googleapis.com/118.0.5993.70/chromedriver_mac64.zip

in other words it (the webdrivers gem) is still looking at the old location for the new version.

Edit: Ultimate Resolution

I never found a solution to this, and my company still has not upgraded our Ruby/Rails, but I was able to get around this issue by using github codespaces to run specs, setup via adding the following to the Dockerfile:

# Setup ChromeDriver
ARG CHROMEDRIVER_VERSION=114.0.5735.90

# Install Google Chrome and ChromeDriver
RUN wget -q https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip \
    && unzip chromedriver_linux64.zip \
    && rm chromedriver_linux64.zip \
    && mv chromedriver /usr/local/bin/
RUN wget -q -O google-chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.90-1_amd64.deb \
    && dpkg -i google-chrome.deb \
    && apt-get install -y -f \
    && rm google-chrome.deb
1

There are 1 best solutions below

1
Grant Kimball On

Try selenium 4.9.1 and update your chromedriver to 119.0.0

This worked for me after the update.