Skip to content

fix(mcp): surface the missing executable path when a browser isn't installed - #41941

Merged
Devin Rousso (dcrousso) merged 1 commit into
microsoft:mainfrom
dcrousso:improve-missing-executable-message
Jul 23, 2026
Merged

fix(mcp): surface the missing executable path when a browser isn't installed#41941
Devin Rousso (dcrousso) merged 1 commit into
microsoft:mainfrom
dcrousso:improve-missing-executable-message

Conversation

@dcrousso

Copy link
Copy Markdown
Contributor

when a browser binary is missing, throwIfExecutableMissing caught playwright-core's Executable doesn't exist at <path> and rethrew a generic Browser "<name>" is not installed, dropping the path

that path holds the version-specific directory (e.g. firefox-1534), which is what tells a genuinely missing install apart from a version mismatch

browsers from a standalone playwright install land in a differently-versioned directory than the bundled playwright-core expects

keep the path in the rethrown message so the mismatch is diagnosable

this is a further improvement for #40867

referenced in #41871

…stalled
when a browser binary is missing, `throwIfExecutableMissing` caught playwright-core's `Executable doesn't exist at <path>` and rethrew a generic `Browser "<name>" is not installed`, dropping the path
that path holds the version-specific directory (e.g. `firefox-1534`), which is what tells a genuinely missing install apart from a version mismatch — browsers from a standalone `playwright install` land in a differently-versioned directory than the bundled `playwright-core` expects
keep the path in the rethrown message so the mismatch is diagnosable
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [chrome] › mcp/cli-core.spec.ts:168 › dialog-accept @mcp-windows-latest-chrome

7794 passed, 1266 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the CI failures here.

🟢 The one failure is a pre-existing flake — this PR is clear

[chrome] › mcp/cli-core.spec.ts:168 › dialog-accept failed on mcp-windows-latest-chrome, but it's a known Windows flake, not something this PR caused. The same test failed with the identical error on PR #41909 (sha 7faf1c08), which this PR can't be responsible for. The diff only touches the missing-executable message in browserFactory.ts and tests/mcp/launch.spec.ts — nothing the dialog flow exercises.

Details

Pre-existing flake / infra

  • [chrome] › mcp/cli-core.spec.ts:168 › dialog-accept (mcp-windows-latest-chrome) — across the test-results DB this test is bimodal only on Windows and only rarely: chrome passed 164 of 165 runs (the one fail is this PR), and msedge passed 164 of 165 (the one fail was PR fix(mcp): report malformed JSON config instead of falling back to INI #41909, run 29863130236, sha 7faf1c08). Both failures share the exact same signature:

    Error: expect(received).toContain(expected) // indexOf
    Expected substring: "[\"alert\" dialog with message \"MyAlert\"]"
    

    Same test failing on an unrelated SHA is the proof this is flake, not regression. On every non-Windows bot it's 0 failures over 400+ runs each. This PR changes how a missing browser executable is reported (throwIfExecutableMissing in browserFactory.ts) plus a launch test — the dialog-accept path doesn't go anywhere near that code.

Triaged by the Playwright bot - agent run

@dcrousso
Devin Rousso (dcrousso) merged commit 610977b into microsoft:mainJul 23, 2026
17 of 18 checks passed
@dcrousso
Devin Rousso (dcrousso) deleted the improve-missing-executable-message branch July 23, 2026 15:31
Yury Semikhatsky (yury-s) added a commit to microsoft/playwright-mcp that referenced this pull request Aug 6, 2026
## What's New
### Tool Improvements
- **`browser_take_screenshot` — WebP format** — New `type` option to
pick the image format (`png`, `jpeg` or `webp`); when unset, the format
is inferred from the filename extension
([#41152](microsoft/playwright#41152))
- **`--codegen` — more languages** — Code generation now supports
`python`, `java` and `csharp` in addition to `typescript`
([#42106](microsoft/playwright#42106))
- **Configurable settle delay** — New `--timeout-settle` flag (and
`timeouts.settle` config option) to control how long to wait after each
action for triggered work (navigations, requests) to settle, defaults to
500ms ([#41924](microsoft/playwright#41924))
## Fixes
- Aria snapshot capture is skipped when the response discards it
([#41923](microsoft/playwright#41923))
- New `--snapshot-boxes` flag (and `snapshot.boxes` config option) to
enable bounding boxes in snapshots globally — previously this was only
available per command
([#42102](microsoft/playwright#42102))
- Reconnect to the browser after a disconnect
([#41966](microsoft/playwright#41966))
- Report malformed JSON config instead of silently falling back to INI
parsing ([#41909](microsoft/playwright#41909))
- Clear the dialog modal state when a dialog is closed out of band
([#42032](microsoft/playwright#42032))
- Detect downloads via the download event instead of guessing from
`net::ERR_ABORTED` navigation errors
([#41933](microsoft/playwright#41933))
- Surface the missing executable path when a browser isn't installed
([#41941](microsoft/playwright#41941))
- Escape user input in codegen output
([#41962](microsoft/playwright#41962))
- Removed the stale `--output-mode` CLI option
([#41833](microsoft/playwright#41833))
### Browser Extension
- Validate `Host` and `Origin` headers on CDP relay WebSocket upgrades
([#42103](microsoft/playwright#42103))
- Launch the Chrome profile that has the extension installed
([#41939](microsoft/playwright#41939))
- Pass `noDefaults` for extension CDP connections
([#42119](microsoft/playwright#42119))
- Mention `PLAYWRIGHT_MCP_EXECUTABLE_PATH` in the error shown when the
browser executable is not found
([#42122](microsoft/playwright#42122))
- Removed support for extension protocol v1
([#41857](microsoft/playwright#41857))
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@dcrousso@dgozman