Read more

Chromedriver: Disabling the w3c option might break your integration tests with Chrome 91

Florian Leinsinger
May 31, 2021Software engineer at makandra GmbH

We recently noticed issues with Chrome 75+ when having the w3c option enabled within the Selenium webdriver. It looks like recent Selenium versions don't have any issues with the w3c interface anymore. And starting with Chrome 91 this fix might cause unexpected issues, so you should try to enabled this option again or just remove the following line from you configuration:

options.add_option('w3c', false)
Illustration book lover

Growing Rails Applications in Practice

Check out our e-book. Learn to structure large Ruby on Rails codebases with the tools you already know and love.

  • Introduce design conventions for controllers and user-facing models
  • Create a system for growth
  • Build applications to last
Read more Show archive.org snapshot

Background: Setting the w3c option to false will enforce a legacy mode Show archive.org snapshot in Chrome starting with version 91. This results in a different value of input.value and input.text (nil instead of empty string) and will cause unexpected errors with Selenium. You will see errors in your integration tests like below if you are affected by the issue:

The field's content "" did not match "some-text" (RSpec::Expectations::ExpectationNotMetError)

Issue with headless Chrome

After removing the line above in the configuration it could happen that the tests are no longer running in headless mode. Updating the selenium-webdriver gem to >= 3.13.0 fixed the problem.

Issue with old Capybaras

You may also need to upgrade your Capybara version.

Posted by Florian Leinsinger to makandra dev (2021-05-31 13:00)