Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Most Playwright .NET browser launch errors come from a missing or mismatched browser installation, absent operating-system dependencies, or differences between your local machine and CI. Build the project, run the generated playwright.ps1 install from the correct target-framework output directory, and check that the install and test processes use the same browser cache. For Linux CI, install system dependencies with --with-deps. If the cause is not obvious, enable DEBUG=pw:browser before changing launch options.

Start with the first error line

Use the first specific message in the exception to choose a fix. Changing ExecutablePath or adding launch flags before identifying the failure can mask an installation problem without resolving it.

Error or symptom Likely cause First action
Executable doesn't exist at … ms-playwright The required browser binary is missing, was installed for a different Playwright package version, or is in a different cache directory. Build the project, rerun the generated install script, and compare PLAYWRIGHT_BROWSERS_PATH in the installation and test environments.
Host system is missing dependencies to run browsers Required operating-system libraries are not installed. On Linux, run the generated script with install --with-deps, or install dependencies separately.
Browser download fails, times out, or reports a certificate error A proxy, certificate authority, restricted network, or slow connection is interfering with the download. Check the documented proxy, download-host, certificate, and timeout environment variables.
Browser installs but fails to launch in a container The image may not match the project’s Playwright version, or the selected browser may be incompatible with the image’s system libraries. Align the image and package versions; avoid Alpine for Playwright Firefox or WebKit images because those builds require glibc.
Only installed Chrome or Edge fails An enterprise browser policy or a version mismatch may block automation. Try the bundled browser first; use a branded channel only when it is required.

Reinstall the matching browser

The Playwright .NET package and its browser binaries are a versioned pair. Microsoft states that “Each version of Playwright needs specific versions of browser binaries to operate.” Restoring or building the .NET package does not by itself guarantee that the matching browser is installed. After upgrading Playwright, run the install command again.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Build the project so the generated Playwright script is available:

    dotnet build
  2. Run the script from the output directory for the project’s target framework. Replace netX with the actual framework, for example net8.0:

    pwsh bin/Debug/netX/playwright.ps1 install
  3. On a Linux CI agent, install the operating-system dependencies as well as the browser:

    pwsh bin/Debug/netX/playwright.ps1 install --with-deps
  4. Inspect which browser revisions are installed, if needed:

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    pwsh bin/Debug/netX/playwright.ps1 install --list

If installation is part of a build, the .NET API can also invoke it with Microsoft.Playwright.Program.Main(new[] { "install" }). Check the returned exit code and fail the build when it is nonzero; otherwise a failed installation can be hidden until a later test run.

Check the browser cache path

Playwright uses a per-user cache by default. A browser installed under one account or path is not necessarily available to the account that runs tests. The documented default locations are:

Operating system Default browser cache
Windows %USERPROFILE%AppDataLocalms-playwright
macOS ~/Library/Caches/ms-playwright
Linux ~/.cache/ms-playwright

If your build or agent uses a shared cache, set PLAYWRIGHT_BROWSERS_PATH to that directory for both installation and test execution. A common failure is setting it only in one step. Also check that the install and test steps run as the same user or have the necessary access to the shared directory.

Browser caching in CI needs care. If you cache browser binaries, include the Playwright package version in the cache key so a package upgrade cannot reuse incompatible revisions. Official guidance says dependency installation is not cacheable on Linux; do not treat a cached directory as a substitute for installing the required system dependencies.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install Linux dependencies and choose the right display mode

On Linux, browser binaries can exist and still fail at launch when shared libraries are missing. Use install --with-deps on an agent where the install step can install system packages. If your environment separates browser downloads from operating-system provisioning, run the generated script’s dependency-install command:

pwsh bin/Debug/netX/playwright.ps1 install-deps

Headless execution does not require a visible desktop, but headed browser runs on Linux need a display server. In CI, use Xvfb when you need headed mode:

xvfb-run dotnet test

Playwright’s stated .NET system requirements include Windows 11 or Windows Server 2019 and later, macOS 14 and later, and Debian 12/13 or Ubuntu 22.04/24.04/26.04 on x86-64 or arm64. If your runner is outside those listed platforms or versions, do not assume a launch failure has the same remedy as a supported host.

Make CI and containers reproducible

A local success does not prove the CI environment has the same browser revision, libraries, display server, or cache. Record and compare the environment where the failure occurs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a local-versus-CI comparison, capture the selected browser, Playwright package version, target framework, operating system or container image, browser-cache path, and complete first exception. Differences in any of these can explain why the same test behaves differently.

Turn on browser diagnostics before changing launch code

Enable Playwright’s browser-level logs when the error says the browser failed to launch:

DEBUG=pw:browser dotnet test

Microsoft’s CI documentation specifically recommends pw:browser when debugging “Error: Failed to launch browser” errors. For broader Playwright API logging, use DEBUG=pw:api. These logs can help distinguish a missing executable from a process that starts and then exits.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In a cross-platform CI configuration, set the environment variable using the syntax appropriate to that shell or job runner. Keep the full exception and relevant logs from the failed run; the first error line plus the browser and environment details is more useful than changing several launch options at once.

Handle download, proxy, certificate, and timeout failures

Playwright downloads browsers from Microsoft’s CDN by default. If a corporate network or slow link interrupts that download, check which condition applies before changing the browser launch configuration:

Set only the variable that matches the observed failure, and make sure it is present in the step that performs installation. A test process cannot launch a browser that a separate installation step failed to download.

Choose a browser engine to isolate the failure

Playwright supports Chromium, Firefox, and WebKit. If only one engine fails, run that engine separately before treating the issue as a general .NET or CI problem. The selected browser can be controlled through BROWSER, runsettings, or dotnet test arguments, depending on how the test project is configured. Record the exact engine used alongside the exception so that an engine-specific problem is not confused with a missing shared dependency.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Should you set ExecutablePath or use Chrome and Edge?

Usually, no. Playwright’s BrowserType API warns: “Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk.” The bundled browsers are the most controlled choice because Playwright updates supported browser revisions with its releases.

A system Chrome or Edge channel is an option when a test specifically needs that branded browser. It also adds compatibility variables: the installed browser version may differ, and enterprise policies can block automation. An arbitrary executable supplied through ExecutablePath is a last-resort compatibility choice, not a reliable repair for a missing Playwright installation.

Choice Compatibility control Additional risk or maintenance
Playwright bundled browser Uses the browser revision expected by the installed Playwright package. Rerun installation after package upgrades.
Branded Chrome or Edge channel Useful when testing a branded browser is a requirement. Browser version and enterprise policy can affect automation.
Arbitrary ExecutablePath Allows an explicit executable path. Playwright does not guarantee compatibility with arbitrary browser versions.

Or skip the browser setup

If your goal is to capture a website image or PDF rather than run browser automation tests, ScreenshotNeo provides a website screenshot API and MCP server for developers. One GET request returns a PNG, JPEG, WebP, or PDF. For details on request options, see the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Cookie banners, newsletter popups, and chat widgets are removed before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits cost nothing; response headers report the page verdict and whether the request was billed. An MCP server lets AI agents using Claude, Cursor, or another MCP client take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000 screenshots.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sign up for ScreenshotNeo’s free plan to start with 1,000 screenshots a month and no card required.

Frequently asked questions

Does Playwright package restore install browsers?

No. Restore and build the project, then run its generated playwright.ps1 install command to download the browser binaries required by that package version.

Can I install browsers through code instead of a script?

Yes. You can call Microsoft.Playwright.Program.Main(new[] { "install" }); check its exit code and fail the build if it is nonzero.

Why does only headed Linux execution fail?

A headed Linux browser needs a display server. In CI, run it under Xvfb, for example with xvfb-run dotnet test.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which browser should I test first when only one engine fails?

Run the failing engine by itself using your project’s BROWSER, runsettings, or dotnet test configuration. Isolating Chromium, Firefox, or WebKit helps establish whether the problem is engine-specific.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.