Parallel Testing with App Automate
BrowserStack supports running tests simultaneously across multiple device-OS combinations. This feature is called parallel testing. It provides the same benefits as running a multi-threaded application.
Parallel Testing helps you reduce the run time of your test suite, resulting in faster build times and faster releases.
In this guide, you’ll learn:
- How do organizations benefit from running tests in parallel
- What are the best practices to run tests in parallel
- How does parallel testing work on BrowserStack
- How to get started with parallel testing
How do organizations benefit from running tests in parallel
As software teams use the continuous integration and delivery (CI/CD) model, the speed of software delivery becomes crucial. With faster builds, you can:
- Release faster and more frequently: Your customers don’t have to wait longer for any 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’s 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.
Best Practices to run tests in parallel
The major challenge to parallelize tests is how to write tests that run at the same time without impacting each other and producing flaky results.
Some best practices to overcome this challenge are as follows:
- Create independent tests: Ensure the tests you want to run in parallel are independent of each other. Running dependent tests in parallel might result in flaky results.
- Manage test data: Ensure that each test uses their test data and does not depend on data generated from any previous tests. Either the data used by individual tests should be isolated or the data should be restored in the same state as it was prior to any test run. Also, ensure test run updates don’t overwrite each other.
- Use Your Framework’s Built-In Functionality: If your framework supports parallel testing, you can instruct the test framework about the number of parallel processes you want. The test runner will create a new thread for the number you specify, thus easing the parallel testing process.
- Start with fewer tests that are easy to isolate: Start with the tests that can be most easily converted to parallel, then adapt some or all of the remaining tests after your team is confortable with the parallel testing environment. Once you have started to use parallel testing and have integrated it into your development process, it is easy to expand the quantity and scope of parallel tests as the need arises.
How does parallel testing work on BrowserStack
Your App 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 device configurations above your parallel limit that you have purchased.
- The additional tests will be queued and they will 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 purchased.
- 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.
How to get started with parallel testing
To start Parallel Testing, you can use any of the popular test frameworks like Lettuce and Behave which help you use Python to write Appium test scripts.
Need some help?
If you have any queries, get in touch with us.
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!