testcafe cannot obtain browser: how to fix
Fixes TestCafe 'cannot obtain browser' launch failures. Use when TestCafe cannot start the browser. Not for in-test failures.
TL;DR
TestCafe cannot launch the named browser: it is not installed, the name is wrong, or the sandbox blocks it. Verify the browser path, use the correct alias, and disable the sandbox in containers.
Error
ERROR Cannot obtain the browser: The browser "chrome" is not installed.Steps
- List installed browsers and use the exact alias (
chrome,chrome:headless, or a path). Expected: the name matches reality. - In Docker, run with
--no-sandboxequivalents or a non-root user with proper flags. Expected: the sandbox stops blocking launch. - Pass an explicit path:
testcafe /path/to/chrome tests/. Expected: no alias guessing. - Check the browser launches manually in the container. Expected: rules out TestCafe vs environment.
- Re-run. Expected: browser opens.
When to use
Cannot obtain the browserat startup.- Containerized runs.
When not to use
- Tests start but fail (in-test issue).
- You want headed debugging (separate concern).
Tool compatibility
- TestCafe latest; Chrome, Firefox, Edge.
Variant phrasings
TestCafe browser not found
Alias or path wrong.
TestCafe failed to start Chrome in Docker
Sandbox flags needed.
Why it happens
TestCafe launches real browsers by name. Containers often lack them or block their sandbox.
Edge cases
chrome:headlessvschromebehave differently in CI; prefer headless.- Browser auto-updates break pinned TestCafe versions; pin both.
- Remote browsers need the browser provider plugin, not a local alias.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_ZzrKXrRYmdOxoGKvJE4i2Q
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.