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

by
Ali Hasan
concurrent-ruby google-chrome ruby-on-rails selenium-webdriver webdrivers-gem

Quick Fix: Update Selenium to version 4.9.1 and Chromedriver to version 119.0.0 to resolve compatibility issue with the latest macOS Ventura and Chrome browser version 118.

The Problem:

An existing Ruby on Rails application that uses Capybara for testing encountered an error after updating the operating system to macOS Ventura. The error is caused by a mismatch between the installed version of ChromeDriver (114) and the current version of Chrome browser (118). The application is unable to use the corresponding version of ChromeDriver (114) and attempts to use the installed Chrome version (118). The issue persists despite attempts to manually specify the Chrome browser version or update ChromeDriver through brew. Setting the required version manually results in a network error. Upgrading Ruby/Rails is the recommended solution, but in the meantime, running specs using GitHub Codespaces can provide a workaround.

The Solutions:

Solution 1: Downgrade Selenium and Update ChromeDriver

If you are unable to upgrade your Ruby/Rails/gems due to various constraints, you can try downgrading your Selenium version to 4.9.1 and updating your ChromeDriver to version 119.0.0. Here’s how you can do it:

1. **Downgrade Selenium to version 4.9.1:**
– In your Gemfile, change the line for the selenium-webdriver gem to:
“`
gem ‘selenium-webdriver’, ‘4.9.1’
“`
– Run `bundle update` to install the new version of the gem.

2. **Update ChromeDriver to version 119.0.0:**
– Download ChromeDriver version 119.0.0 for your operating system from the official ChromeDriver website.
– Unzip the downloaded file and move the `chromedriver` executable to a directory that is included in your system’s PATH environment variable.

3. **Restart your tests:**
– Restart your Capybara tests to see if the issue is resolved.

Q&A

Selenium version 4.11 and above requires chromedriver 115+, but I am using version 3.142.7 with chromedriver 114. What is the solution?

You can use selenium 4.9.1 and update your chromedriver to 119.0.0.

How to update to chromedriver version 118 manually without using brew?

Set the required version manually using Webdrivers::Chromedriver.required_version = <desired driver version>.

After updating chromedriver to version 118, I am getting a 404 Not Found error. Why?

Webdrivers gem is still looking at the old location for the new version. Update the gem to the latest version.