Run WD Tests in Parallel
Run multiple WD tests in parallel on BrowserStack Automate
On BrowserStack, you can run multiple WD 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.
With Parallel Testing, you can run the same test on different browser/device combinations i.e. cross-browser testing, or run different tests on the same or different browser/device combinations. Parallel Testing will help you reduce the run time of your test suite, resulting in faster build times and faster releases.
Run sample test in parallel
- Clone the wd-browserstack sample repo on GitHub, if not already done:
git clone https://github.com/browserstack/wd-browserstack.git cd wd-browserstack
- Install the dependencies using
npm install
-
Setup your credentials and browser/devices where you want to run your test, in the
wd-browserstack/conf/parallel.conf.js
file as shown below:parallel.conf.jsexports.config = { user: 'YOUR_USERNAME', key: 'YOUR_ACCESS_KEY', seleniumHost: 'hub-cloud.browserstack.com', seleniumPort: 80, commonCapabilities: [{ "browserstack.debug": true }], "capabilities": [{ "browser": "chrome" },{ "browser": "firefox" },{ "browser": "safari" },{ "browser": "internet explorer" }] }
-
You can now run your tests in parallel on BrowserStack using the following command:
npm run parallel
- You can also run you test in other environments by specifying that in the
capabilities
variable as shown below:"capabilities": [{ "browser": "chrome", "browser_version": "latest", "os": "Windows", "os_version": "10" },{ "device": "iPhone 12 Pro", "browser": "iPhone", "os_version": "14" },{ "browser": "safari", "browser_version": "latest", "os": "OS X", "os_version": "Big Sur" },{ "device": "Samsung Galaxy S20 Ultra", "browser": "Android", "os_version": "10.0" }]
Next steps
Once you have successfully run your first test on BrowserStack, you might want to explore the following:
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!