“Chrome for Testing” for Selenium v4.11+ and Chrome v115+

Execute Selenium test scripts against a specific version of the Google Chrome browser.

Zhimin Zhan
4 min readAug 4, 2023

--

A repost of my daughter’s article with permission. I added a few notes.

Selenium WebDriver v4.11 supports “Chrome for Testing”, a new (and long-waited by some) feature that Google added to make testing different browser versions easier, in particular, pin a specific browser version within test scripts, from v115 onwards.

Test Automation Engineers who use Selenium WebDriver regularly must have noticed the change in the ChromeDriver download page.

Goes to the “Chrome for Testing availability” page, and you see chromedrivers for several channels.

For normal use, you just click the ‘Stable’ link to navigate to the part below, copy the URL for your platform, and paste it into the browser address to get it.

Really, not much different from before.

Some will wonder “What are the benefits of this Chrome for Testing then?” Let me show you an example.

Suppose, you want to run your automated tests against a specific version or the next version (beta) Google Chrome, version v116 at the time of my writing. You can set the browser version in Chrome::Options . Selenium WebDriver will fetch that version (if not installed) in the background, before executing the test script (the below is Selenium in Ruby binding).

the_chrome_options = Selenium::WebDriver::Chrome::Options.new      
the_chrome_options.browser_version = "116"
driver = Selenium::WebDriver.for(:chrome, :capabilities => the_chrome_options)

--

--

Zhimin Zhan

Test automation & CT coach, author, speaker and award-winning software developer. Help teams succeed with Agile/DevOps by implementing real Continuous Testing.