Manage Playwright versions and browsers

As we discussed in the previous article, Playwright tests can only be executed on the browser versions that are shipped with the corresponding Playwright version. For example, Playwright Version 1.31 was shipped with the following browser versions: -

  • Chromium 111.0.5563.19
  • Mozilla Firefox 109.0
  • WebKit 16.4

This version was also tested against the following stable channels:

  • Google Chrome 110
  • Microsoft Edge 110

Playwright always comes with latest Chromium based browsers

"For Google Chrome, Microsoft Edge and other Chromium-based browsers, by default, Playwright uses open source Chromium builds. Since the Chromium project is ahead of the branded browsers, when the world is on Google Chrome N, Playwright already supports Chromium N+1 that will be released in Google Chrome and Microsoft Edge a few weeks later."

To use older versions of browsers, you would need to downgrade your Playwright versions. You can check the required browser version and then either specify the Playwright version in the package.json file or install a specific Playwright version from the command prompt.

To update playwright version using package.json -

"devDependencies": {
    "@playwright/test": "1.24"
  }

To check current playwright version from terminal

npx @playwright/test --version

To download or update playwright version, please run below command -

npm install @playwright/test@latest

To install specific version of playwright, please run below command -

npm install @playwright/test@1.30

//Replace 1.30 with version of your choice

To get browser versions based on the playwright version, run below command -

npx playwright install

NOTE - Prior to upgrading / downgrading your Playwright version, it is recommended to check for any changes that may have been made which could potentially cause breaking changes and affect your existing tests.

Playwright Tutorials: 

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.