Skip to main content
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Run tests in parallel

Speed up your Mobilewright test runs on BrowserStack App Automate using workers.

Mobilewright spreads test execution across workers. Each worker is a separate process holding an active connection to a single device or simulator, so the number of workers you run effectively sets how many devices execute tests at the same time. On BrowserStack App Automate, each worker is backed by its own App Automate session: the @browserstack/mobilewright driver’s device allocator claims one session per worker slot and reconnects to it using that session’s ID.

Enable parallel testing

Raise the worker count to run more than one device at once, either in your config or on the command line:

mobilewright.config.ts
Copy icon Copy
Terminal
Copy icon Copy

With just workers: 2 and no other changes, Mobilewright already parallelizes at the file level. Say your suite has login.spec.ts, checkout.spec.ts, and search.spec.ts: the first two start running at the same time, one per worker, while search.spec.ts waits for whichever finishes first. What doesn’t happen yet is parallelism inside a single file: login.spec.ts’s own tests still run one after another on the one device it was assigned, even while a second worker sits idle waiting for its next file.

Device allocation on BrowserStack

BrowserStack doesn’t reserve a device for every worker before your run starts. It claims a device only when a worker actually needs one, so a worker that finishes early can pick up whichever device becomes free next, rather than sitting idle.

Set your worker count to match how many real devices or simulators are actually available to your CI runner, not higher. For suites too large to finish within that many workers, combine parallel workers with test sharding to split the suite across multiple CI machines.

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 Check Circle