Skip to main content
Cypress 10 support is here! Upgrade your BrowserStack Cypress-CLI to v1.18.0 and start testing. Try now!

Specify Browsers and OS

Learn about setting the OS and browser combinations that are used to run your Cypress tests.

Introduction

Using BrowserStack, you can run your tests on multiple OS-browser combinations simultaneously. Set the combinations using either of the following options:

Setting the browser and OS keys in browserstack.json

Add the browsers object in the browserstack.json file to set a list of OS, browsers, and browser versions that you want to use.

The sample structure of the browsers object is as follows:

browserstack.json
{
  ...
  "browsers": [{
      "os": "<Name of the OS>",
      "browser": "<Name of the browser>",
      "versions": ["latest", "latest-1", "latest-2", "latest-beta"],
    }
  ]
  ...
}

The following table explains the different keys under the browsers object.

key value Possible values
os Name of the operating system Windows 10, Windows 11, OS X Mojave, OS X Catalina, OS X Big Sur and OS X Monterey
browser Name of the browser chrome, firefox and edge
versions A list of supported browser versions Chrome: 66 and above (except 82)
Firefox: 70 and above
Edge: 80 and above (except 82)

It is recommended that you use latest, latest-1, latest-2,latest-beta and so on, to test on the latest n versions of the required browser.
Note: Cypress does not support testing on Safari browser or on real mobile devices yet.
BrowserStack supports all browsers and OSes that are currently supported by Cypress.

Consider the following snippet that shows a sample configuration if you want to run the following OS-browser combination. It is recommended that the latest, latest-1, latest-2, latest-beta, etc. values are used for always using the latest browser versions.

  • Chrome on Windows 10
  • Edge on Windows 10
  • Firefox on OS X Big Sur
  • Chrome on any OS (we would run your test on any OS combination ensuring you get the best possible stability and performance)
browserstack.json
{
  ...
  "browsers": [{
      "os": "Windows 10",
      "browser": "chrome",
      "versions": ["latest", "latest-1", "latest-beta"],
    },
    {
      "os": "Windows 10",
      "browser": "edge",
      "versions": ["latest", "latest-1", "latest-beta"],
    },
    {
      "os": "OS X Big Sur",
      "browser": "firefox",
      "versions": ["latest", "latest-1", "latest-beta"],
    },
    {
      "browser": "chrome",
      "versions": ["latest", "latest-1", "latest-beta"],
    }
  ]
  ...
}
Protip: If running on a specific Operating System is not your use-case, you can choose to omit os from the browserstack.json. We would run your tests on the best possible OS combination keeping stability and performance in mind.

Using the CLI

For CLI versions v1.11.0 or higher, you can also pass the browser and OS combinations through the CLI command. The sample command for the following OS-browser combinations is as follows:

Command Line
browserstack-cypress run --browser "<browser_name>@<browser_version>:<OS_version>","<browser_name>@<browser_version>:<OS_version>"
Argument Accepted values
--browser Accepts a comma-separated list of browser, browser version, and OS combinations. Build runs only on the list of specified browsers.

For example, --browser "chrome@latest:Windows 10","firefox@latest-1:OS X Catalina".
Note: The --browser option is only supported for browserstack-cypress-cli version v1.11.0 and higher. The values that you pass using the CLI command overrides the settings in the browserstack.json file.

Consider the following snippet that shows a sample CLI command if you want to run the following OS-browser combination. It is recommended that the latest, latest-1, latest-2, latest-beta, etc values are used for always using the latest browser versions.

  • Chrome on Windows 10
  • Firefox on OS X Catalina
Command Line
browserstack-cypress run --browser "chrome@latest:Windows 10","firefox@latest-1:OS X Catalina"

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Talk to an Expert