Run Tests in Parallel
Learn how to run your tests in parallel for faster build completion.
We automatically split your spec files, and run the tests on the specified browsers & OS automatically depending on the parallelization settings you’ve configured.
You can specify the number of parallels you want to use for running your tests in two ways:
- Using the CLI param
- Mentioning the parallels limit in the browserstack.json
Using the CLI
You can also use the --parallels
option of the CLI while running your tests
to specify the number of parallels you want to use to run your tests in parallel.
For example:
browserstack-cypress run --sync --parallels 5
Using browserstack.json
You can use parallels
key in the run_settings
option in the configuration
file. You’ll need to mention the number of parallels you want to use to run your
tests in parallel
For example:
{
"run_settings": {
...
"parallels": 5,
...
}
}
Parallelization strategy with an example
Let’s assume a scenario where you have 100 spec files, and want to run tests on the following 3 OS-browser combinations:
- Chrome 80 on Windows 10
- Edge 81 on OS X Mojave
- Firefox 70 on OS X Catalina
If you specify to use 25 parallels, we will try to run the tests as follows depending on how many parallels are available to run your tests:
- We will use 9 machines with Windows 10 & Chrome 80 to run 100 spec files.
- We will use 8 machines each with the other two OS-browser combination to run the 100 spec files on those two OS-browser combinations.
If you specify to use 1 parallel, we will first run all 100 spec files on one machine with Chrome 80 on Windows 10, then do the same with the other two combinations. Obviously, this config will take much longer to finish running.
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
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!