Launching Browsers
What you'll learn​
- Why Cypress launches and controls its own browser
- Which browsers Cypress supports and how to choose between them
- How the Cypress browser environment differs from a regular browser, and why
- How headless mode and file downloads work
- How to troubleshoot browser launching issues
When you run tests, Cypress launches and controls a real browser for you. Rather than attaching to a browser you already have open, Cypress starts its own instance so it can guarantee two things that make automated testing trustworthy:
- A clean, pristine testing environment. Every run starts from a known, isolated state, with no leftover cookies, history, cached logins, or third-party extensions from your day-to-day browsing leaking into your tests. This is what keeps runs reproducible and prevents "works on my machine" flakiness.
- Access to privileged browser automation APIs. Driving the browser directly is how Cypress reads and controls your application reliably, takes screenshots and video, stubs the network, and more.
Cypress currently supports Chrome-family browsers (including Edge and Electron) and Firefox, plus experimental WebKit. Testing across the browsers your users actually use gives you cross-browser confidence. For strategies to do this efficiently in CI, see the Cross Browser Testing guide.
Supported browsers​
When Cypress is launched, you can choose to test your application using a number of browsers, including:
- Chrome for Testing
- Chrome
- Chrome Beta
- Chrome Canary
- Chromium
- Edge
- Edge Beta
- Edge Canary
- Edge Dev
- Electron
- Firefox
- Firefox Developer Edition
- Firefox Nightly
- WebKit (Experimental)
Cypress automatically detects the browsers installed on your OS so you don't have
to configure paths by hand. In cypress open, switch browsers using the drop
down near the top right corner; in cypress run, choose one with the
--browser
flag.

Browser versions supported​
Cypress officially supports the latest 3 major versions of Chrome, Firefox, and Edge. (For example, if the stable release of Chrome was 150, Cypress would officially support Chrome 148, 149, and 150.)
Sticking to recent versions matters because these browsers are evergreen and their automation interfaces evolve quickly, so supporting the latest versions lets Cypress rely on stable, modern automation APIs.
Regardless of the above, Cypress cannot launch Firefox versions older than 135. Cypress automates Firefox through WebDriver BiDi, which is only available in Firefox 135 and above, so older versions will fail with an error.
See each browser's official release schedule for more information.
Download specific Chrome version​
The Chrome browser is evergreen - meaning it will automatically update itself, sometimes causing a breaking change in your automated tests. To keep your test runs deterministic, you can pin a fixed browser version instead of letting it drift. You can use the information in Download Chromium to download a specific released version of Chrome for Testing or Chromium for every platform.
Electron Browser​
In addition to the browsers found on your system, you'll notice that Electron is an available browser. The Electron browser is a version of Chromium that comes with Electron.
The Electron browser comes bundled with Cypress, so it requires no separate installation and is always available. For this reason it is the default browser when running from the CLI. That said, because Electron is not a browser your end users run, we generally recommend testing in another browser.
By default, when running cypress run from the CLI, Cypress launches all browsers headlessly. See Headless mode for details.
You can also launch Electron headed:​
- npm
- Yarn
- pnpm
- Bun
npx cypress run --headed
yarn cypress run --headed
pnpm cypress run --headed
bunx cypress run --headed
Because Electron is the default browser, it is typically the one running in CI.
If you are seeing failures in CI, an easy first debugging step is to run locally
with the --headed option so you can watch what happens.
Chrome Browsers​
All Chrome* flavored browsers are detected and supported by Cypress.
You can launch Chrome like this:
- npm
- Yarn
- pnpm
- Bun
npx cypress run --browser chrome
yarn cypress run --browser chrome
pnpm cypress run --browser chrome
bunx cypress run --browser chrome
To use this command in CI, you need to install the browser you want - or use one of our docker images.
By default, we will launch Chrome headlessly during cypress run. To run
Chrome headed, you can pass the --headed argument to cypress run.
You can also launch Chromium:
- npm
- Yarn
- pnpm
- Bun
npx cypress run --browser chromium
yarn cypress run --browser chromium
pnpm cypress run --browser chromium
bunx cypress run --browser chromium
Or Chrome Beta:
- npm
- Yarn
- pnpm
- Bun
npx cypress run --browser chrome:beta
yarn cypress run --browser chrome:beta
pnpm cypress run --browser chrome:beta
bunx cypress run --browser chrome:beta
Or Chrome Canary:
- npm
- Yarn
- pnpm
- Bun
npx cypress run --browser chrome:canary
yarn cypress run --browser chrome:canary
pnpm cypress run --browser chrome:canary
bunx cypress run --browser chrome:canary
Or Chrome for Testing:
- npm
- Yarn
- pnpm
- Bun
npx cypress run --browser chrome-for-testing
yarn cypress run --browser chrome-for-testing
pnpm cypress run --browser chrome-for-testing
bunx cypress run --browser chrome-for-testing
Where possible, we recommend running your tests in Chrome for Testing. It is a dedicated Chrome flavor that Google builds specifically for automation, and it has a few advantages over a standard, day-to-day Chrome install:
- No auto-update. Regular Chrome is evergreen and silently updates itself, which can change browser behavior between runs and cause tests that passed yesterday to fail today. Chrome for Testing is pinned to a specific version and never updates on its own, so your environment stays deterministic.
- Versioned, reproducible binaries. A matching build is published for every Chrome version and every major OS, so you can install the exact same browser locally and in CI. See Download specific Chrome version.
- Built for automation, not browsing. Because it is intended only for testing, it is not subject to the enterprise/group policies often applied to branded Chrome (such as disabling remote debugging), which removes a common cause of launch failures.
- Extension loading still works. Standard Chrome 137 and above can no longer load extensions via the Browser Launch API, but Chrome for Testing and Chromium still can.
Chrome policy​
If Chrome policy is set, ensure that
RemoteDebuggingAllowed
is either undefined or set to true.
If this is not the case, then Cypress will timeout, returning an ECONNREFUSED error, attempting to connect to the browser.
Chrome policy is generally applied to a Chrome-branded browser only, not to Chromium or Chrome for Testing browsers.
Check by browsing to chrome://policy. See
Cypress failed to make a connection to the Chrome DevTools Protocol
for more.
Skipping Chrome preference reads/writes​
To set up a consistent testing environment, Cypress reads and writes Chrome
preference files inside its isolated profile in the browser's
user-data directory (the Preferences, Secure Preferences, and Local State
files). This is how Cypress applies preference-based settings, for example,
disabling password saving and autofill, configuring the
downloads behavior, and any preferences you set through the
before:browser:launch
event.
Some applications and environments encrypt the user-data directory (for
example, certain enterprise security tooling). In that case, Cypress reading or
writing the preference files can fail or corrupt the encrypted profile. To work
around this, set the IGNORE_CHROME_PREFERENCES system environment variable,
which tells Cypress to skip reading and writing Chrome preferences entirely:
- npm
- Yarn
- pnpm
- Bun
IGNORE_CHROME_PREFERENCES=1 npx cypress run --browser chrome
IGNORE_CHROME_PREFERENCES=1 yarn cypress run --browser chrome
IGNORE_CHROME_PREFERENCES=1 pnpm cypress run --browser chrome
IGNORE_CHROME_PREFERENCES=1 bunx cypress run --browser chrome
Edge Browsers​
Microsoft Edge-family (Chromium-based) browsers are supported by Cypress.
You can launch Microsoft Edge like this:
- npm
- Yarn
- pnpm
- Bun
npx cypress run --browser edge
yarn cypress run --browser edge
pnpm cypress run --browser edge
bunx cypress run --browser edge
Or Microsoft Edge Beta:
- npm
- Yarn
- pnpm
- Bun
npx cypress run --browser edge:beta
yarn cypress run --browser edge:beta
pnpm cypress run --browser edge:beta
bunx cypress run --browser edge:beta
Or Microsoft Edge Canary:
- npm
- Yarn
- pnpm
- Bun
npx cypress run --browser edge:canary
yarn cypress run --browser edge:canary
pnpm cypress run --browser edge:canary
bunx cypress run --browser edge:canary
Or Microsoft Edge Dev:
- npm
- Yarn
- pnpm
- Bun
npx cypress run --browser edge:dev
yarn cypress run --browser edge:dev
pnpm cypress run --browser edge:dev
bunx cypress run --browser edge:dev
Edge policy​
If Edge policy is set, ensure that
RemoteDebuggingAllowed
is either undefined or set to true.
If this is not the case, then Cypress will timeout, returning an ECONNREFUSED error, attempting to connect to the browser.
Check by browsing to edge://policy. See
Cypress failed to make a connection to the Chrome DevTools Protocol
for more.
Firefox Browsers​
Firefox-family browsers are supported by Cypress.
You can launch Firefox like this:
- npm
- Yarn
- pnpm
- Bun
npx cypress run --browser firefox
yarn cypress run --browser firefox
pnpm cypress run --browser firefox
bunx cypress run --browser firefox
Or Firefox Developer Edition:
- npm
- Yarn
- pnpm
- Bun
npx cypress run --browser firefox:dev
yarn cypress run --browser firefox:dev
pnpm cypress run --browser firefox:dev
bunx cypress run --browser firefox:dev
Or Firefox Nightly:
- npm
- Yarn
- pnpm
- Bun
npx cypress run --browser firefox:nightly
yarn cypress run --browser firefox:nightly
pnpm cypress run --browser firefox:nightly
bunx cypress run --browser firefox:nightly
To use this command in CI, you need to install these other browsers - or use one of our docker images.
By default, we will launch Firefox headlessly during cypress run. To run
Firefox headed, you can pass the --headed argument to cypress run.
Mozilla geckodriver​
Cypress requires the Mozilla geckodriver to launch Firefox. To meet this requirement, the Cypress binary uses the separate npm wrapper package geckodriver to provide the Mozilla geckodriver. The wrapper downloads the latest driver version if it does not find any driver version cached locally.
Retrieving the driver may fail if you are operating Cypress in an air-gapped environment without Internet connectivity and you do not have a cached driver version available.
To avoid this issue, use a current
Cypress Docker image cypress/browsers or cypress/included, built with Firefox 139, or above.
These images include a Mozilla geckodriver version pre-installed.
Using cypress/factory:5.9.0, or above, you can also build your own custom Cypress Docker image that includes a Mozilla geckodriver version.
Refer to the cypress/factory
documentation for instructions on building custom images.
If you need to work without Docker, refer to the npm wrapper package geckodriver documentation for information about how to define a custom path for the driver or how to refer to a local CDN mirror site. Download the Mozilla geckodriver from the releases location.