browserstack/browserstack-runner

using browserstack-runner for parallel integration tests in browserstack

Closed this issue · 4 comments

I don't have much experience with Automated integration testing, so I will try to articulate my question as clearly as possible with my lack of vocabulary in this area.

I have been writing integration tests with Selenium and Browserstack, and I have it currently set up that it tests a certain page in each browser, one at a time. I see there is a possibility of speeding this process up with parallel testing and testing multiple browsers at a time instead of one at a time, and that is how I came across browserstack-runner.

After taking a look at the browserstack-runner sample test and running the tests, I saw in Browserstack that it ran the tests at the same time. Looking in the code, however, I see that this is really intended for unit testing as opposed to integration testing. I am wondering if there is a way (and how) to run my selenium script to do the same thing. For instance, spinning up multiple instances of the webdriver and running the same test in 5 different browsers at once. Is this possible? And if so, how can I accomplish this?

Yes, It is possible. Firstly, to run Selenium Tests on BrowserStack you will need an Automate account. You can read more about it here(https://www.browserstack.com/automate). BrowserStack-runner is used for Automated JavaScript testing(it does not use Selenium Webdriver). You can then spin multiple instances of the webdriver(Selenium Webdriver) and run parallel tests.

Adding to @nidhimj22 answer, you can use different testing frameworks to run your Selenium tests in parallel. You can check the documentation for various frameworks in Node.js here - https://www.browserstack.com/automate/node#testing-frameworks

Would also suggest checking out Selenium-Runner that runs 'wd' (Selenium) tests in parallel.

I do have an Automate account and have been running JavaScript tests via Browserstack, I guess my question is how to spin up the multiple tests at once.
@UmangSardesai I've been playing around with Nightwatch.js, but having a little difficulty getting it to properly run multiple instances. The documentation is alright, but doesn't seem to be working properly.
In terms of "wd", I have been working with that too, and that does work with running parallel testing for me, just having issues with the syntax and the endless callback functions. Not as intuitive as Nightwatch.js syntax

You need to give the different browsers under test settings as given in the settings.json file here. To run your Nightwatch test in parallel across these browsers (as mentioned under default and chrome), execute the command:

nightwatch -e default,chrome