Chrome for Testing: Enhancing Browser Automation with Secure Downloads

Ashish
3 min readAug 7, 2023

--

Chrome for Testing

In the ever-evolving landscape of web development, browser testing remains a critical facet to ensure optimal user experiences. The complexities of configuring an effective browser testing environment have long been a concern for developers. To address this challenge, a new variant of Chrome named “Chrome for Testing” has been meticulously designed.

This article delves into the motivations behind the creation of Chrome for Testing and showcases its practical applications for developers engaged in web application testing and automation.

Crafted for Automation and Testing

Chrome for Testing emerges as a specialized version of Chrome, purpose-built for browser automation and testing endeavors. It’s important to note that this variant isn’t intended for casual web browsing.

The Significance of Browser Testing

Browser testing is pivotal for delivering a seamless browsing experience to users, whether executed manually or through automated procedures. However, setting up a robust testing environment has traditionally been a stumbling block for developers. With this in mind, the developers behind Chrome for Testing have aimed to alleviate some of these challenges.

Navigating Auto-Updates

Chrome’s automatic updating mechanism is a valuable feature for regular users, ensuring security and access to the latest web features. However, for developers focused on end-to-end testing, this feature presents challenges:

  1. Consistency is key in testing, and unexpected browser updates can disrupt this consistency across test runs.
  2. Developers often need to work with specific browser versions for traceability and reproducibility, a need that conflicts with Chrome’s auto-update mechanism.

These challenges underscore the divergence between the needs of everyday users and those of developers who engage in automated testing.

Challenges with Versioned Binaries

Securing a specific version of the Chrome binary can be a daunting task due to Google’s policy of pushing users to the latest version. This approach, while beneficial for regular users, hinders developers attempting to replicate issues on older Chrome versions.

This problem becomes even more pronounced when ChromeDriver, a tool for browser automation, comes into play. Matching ChromeDriver to the appropriate Chrome version is a complex task.

To tackle this, some developers turn to Chromium binaries instead of Chrome. However, this approach is not without its shortcomings. Chromium binaries lack uniform availability, are developed separately from Chrome, and differ from it in key aspects.

The Solution: Chrome for Testing

In response to these challenges, the developers have unveiled Chrome for Testing — a specialized version of Chrome tailored precisely to the needs of testing. Unlike the standard Chrome, this variant refrains from auto-updates. It mirrors the regular Chrome experience while catering optimally to testing needs.

Creating Chrome for Testing involved extensive changes to both the Chromium and Chrome codebases. The developers also established the infrastructure to build and distribute these versioned binaries, aligning them with the Chrome release process for all channels.

The implications of Chrome for Testing extend beyond the browser itself. By integrating the ChromeDriver release process, the problem of aligning Chrome and ChromeDriver binaries is addressed. This integration not only streamlines the process but also eliminates the need for manual ChromeDriver releases.

Accessing Chrome for Testing Binaries

Obtaining Chrome for Testing binaries is made easy through the @puppeteer/browsers command-line utility, available on npm.

Examples of usage include:

# Download the latest available Chrome for Testing binary corresponding to the Stable channel.
npx @puppeteer/browsers install chrome@stable

# Download a specific Chrome for Testing version.
npx @puppeteer/browsers install chrome@116.0.5793.0

# Download the latest available ChromeDriver version corresponding to the Canary channel.
npx @puppeteer/browsers install chromedriver@canary

# Download a specific ChromeDriver version.
npx @puppeteer/browsers install chromedriver@116.0.5793.0

For those who prefer scripting their own download automation, JSON API endpoints provide the latest version details for each Chrome release channel.

Before you leave

Chrome for Testing is a specialized solution aimed at addressing the challenges faced by developers in browser automation and testing. Its versioned binaries, tailored to different Chrome release channels, promise to streamline the testing process while enhancing compatibility with ChromeDriver.

--

--

Ashish

💻 Product Marketer & 🧪 Software Tester 💼 Experienced in driving growth & improving user experience. 💡 A problem solver, always seeking innovative solutions.