Each version of Playwright requires specific versions of browser binaries to work. Depending on the language you use, Playwright will either download these browsers at package installation time or you will need to use the Playwright CLI to install these browsers.

With each release, Playwright updates the versions of the browsers it supports so that the latest version of Playwright is compatible with the latest browsers at any time. It means that every time you update playwright, you may need to run the install CLI command again.

Make sure your Maven path is set, you can follow my other article here .

CMI Commands to install different browsers

  1. Installing default browsers
     mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install"

2.Installing required custom browser, one can install custom browsers, supports chromium, chrome, chrome-beta, msedge, msedge-beta, msedge-dev, firefox, webkit.

      mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install chrome"

      mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install msedge"

3.Installing system dependencies

System dependencies can get installed automatically. This is useful for CI environments.

mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install-deps"

It’s also possible to combine install-deps with install and install by that the browsers and OS dependencies with a single command. This would do both for Chromium, but you can also leave it out.

mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install --with-deps chromium"