Skip to main content
Introducing the Automate SDK! Get your entire test suite running on BrowserStack in minutes! Learn More.

Run Selenide Tests in Parallel

On BrowserStack, you can run multiple Selenide tests at the same time across various browser, device, and OS combinations. This is 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

  1. Clone the selenide-browserstack sample repo on GitHub, if not already done:
     git clone -b selenium-4 https://github.com/browserstack/selenide-browserstack.git
     cd selenide-browserstack
    
  2. Install the dependencies using mvn compile

  3. Setup your credentials and browser/devices where you want to run your test, in the parallel.conf.json file as shown below:

    selenide-browserstack/src/test/resources/conf/parallel.conf.json
     {
       "server": "hub-cloud.browserstack.com",
       "user": "YOUR_USERNAME",
       "key": "YOUR_ACCESS_KEY",
    
       "capabilities": {
         "project": "Example",
         "build": "Java Selenide Parallel",
         "name": "Bstack-[Selenide] Parallel Test",
         "browserstack.debug": true
       },
    
       "environments": {
         "chrome": {
           "browser": "chrome"
         },
         "firefox": {
           "browser": "firefox"
         },
         "safari": {
           "browser": "safari"
         }
       }
     }
    

    Also, you will need the parallel.selenide.xml file as shown below (exists in the sample repo):

    selenide-browserstack/config/parallel.selenide.xml
     <?xml version="1.0" encoding="UTF-8"?>
     <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
     <suite name="Parallel" thread-count="3" parallel="tests">
     	<test name="SingleTestChrome">
         <parameter name="config" value="parallel.conf.json"/>
         <parameter name="environment" value="chrome"/>
         <classes>
           <class name="com.browserstack.SingleTest"/>
         </classes>
     	</test>
    
     	<test name="SingleTestFirefox">
         <parameter name="config" value="parallel.conf.json"/>
         <parameter name="environment" value="firefox"/>
         <classes>
           <class name="com.browserstack.SingleTest"/>
         </classes>
     	</test>
    
     	<test name="SingleTestSafari">
         <parameter name="config" value="parallel.conf.json"/>
         <parameter name="environment" value="safari"/>
         <classes>
           <class name="com.browserstack.SingleTest"/>
         </classes>
     	</test>
     </suite>
    
  4. You can now run your tests in parallel on BrowserStack using the following command:

     mvn test -P parallel
    
Note: Achieve your test coverage and build execution time goals by using our calculator to understand how many parallel sessions you need.

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