Skip to main content

Speed up Your Tests

Achieve faster build times with parallel testing and meet your continuous deployment goals.

Common questions around parallel testing

What is parallel testing?

On BrowserStack, you can run multiple tests at the same time across various browser, device and OS combinations. This is called parallel testing. Parallel testing gives you the same benefits as running a multi-threaded application.

How do organizations benefit from running tests in parallel?

As software teams move towards the continuous integration and delivery (CI/CD) model, the pace of software delivery becomes more essential. With faster builds, you can:

  • Release faster and more frequently: Your customers don’t have to wait for that latest feature or bug fix.
  • Improve automation coverage without worrying about the wait time: You can automate more test cases without worrying about increasing your build time. It will help you improve automation coverage and reduce manual testing.
  • Reduce developer frustration with faster feedback loops: Waiting for a test run to complete can be frustrating at times. With faster builds, your developers can focus on writing code instead of waiting for builds to complete.

How does parallel testing work on BrowserStack?

Your Automate plan supports running the number of parallel tests that you have purchased (5 during free trial). But with test queueing, you can send more parallel test requests to BrowserStack than your plan limit.

The following are the salient points for queueing your tests:

  • You can launch an additional number of parallel tests with different browser configurations above your parallel limit that you have purchased.
  • The additional tests will be queued and they would run as and when your existing running tests complete their execution.
  • For instance, if you want to run 5 additional tests, apart from your subscribed limit of, say, 2 parallel tests, we will queue the additional 5 tests until one of the 2 initial tests finish, and a slot is available for execution.
  • With queuing, you don’t need to worry about managing your test pipeline - we automatically take care of scheduling and execution for you.
  • With this feature, BrowserStack accounts with 1-5 parallels, can queue 5 tests. And, accounts with more than 5 parallels will have a max queue length equal to the number of parallels.
  • For example, if you have 2 parallel tests for your account, you can queue up to 5 more tests, but if you have 200 parallel tests, you can queue up to 200 more tests.

Configure test suites for parallel

Add devices config

You can skip this step if you’ve added these previously. Otherwise, create a combination of objects in your test_settings object found in your Nightwatch config file.

Configure workers to set the number of parallels

You can create multiple threads for parallel execution by adding the test_workers top-level property like the following example:

{
  "test_workers": {
    "enabled": true,
    "workers": "auto"
  }
}

or

{"test_workers": true}

The workers option configures the maximum number of devices that should be created in parallel in BrowserStack. For example, to set the maximum number of parallels as four, you need to update the Nightwatch configuration settings as follows:

{
  "test_workers": {
    "enabled": true,
    "workers": "4"
  }
}

Please refer to the Nightwatch parallel testing tutorial for more info on this.

Execute test suite through terminal

Here is how you invoke Nightwatch to run on the designated devices as shown in the config file.

  capabilities: [{
    'bstack:options': {
      deviceName: 'Google Pixel 3',
      osVersion: "9.0"
    }
  }, {
    'bstack:options': {
      deviceName: 'Samsung Galaxy S10e',
      osVersion: "9.0"
    }
  }]
npx nightwatch ios/examples/run-sample-test/test.conf.js
npx nightwatch android/examples/run-sample-test/test.conf.js

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
Download Copy