Can you run multiple suites from single testNG.xml in parallel mode ?

4,986 views
Skip to first unread message

SSR

unread,
Mar 28, 2016, 9:51:42 AM3/28/16
to testng-users
Hello,
I have a testNG structure as follows.  Suite XX and Suite YY has same set of tests. I would like to run Suite XX and Suite YY in parallel with different browsers on different VMS. Is it possible to run Suites in parallel mode.?

<suite name="XX">
      <parameter name="browser" value = "firefox">
      <test name="a">
           <classes>
                 <class name= "a" />
           </classes>
       </test>
       <test name="b">
           <classes>
                 <class name= "b" />
           </classes>
       </test>
</suite>

<suite name="YY">
      <parameter name="browser" value = "IE">
      <test name="a">
           <classes>
                 <class name= "a" />
           </classes>
       </test>
       <test name="b">
           <classes>
                 <class name= "b" />
           </classes>
       </test>
</suite>

Thanks


⇜Krishnan Mahadevan⇝

unread,
Mar 28, 2016, 11:41:39 PM3/28/16
to testng...@googlegroups.com
Sneha,
To the best of my knowledge you cannot do this with a suite of suites in TestNG.

But you can do this if you pass in the suite names individually.

Please take a look at this blog post of mine to learn how to do it : https://rationaleemotions.wordpress.com/2016/03/29/parallel-execution-of-multiple-testng-suites/

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

SSR

unread,
Mar 29, 2016, 9:31:18 AM3/29/16
to testng-users
Thanks Krishnan. That was helpful but I am building my xml dynamically and running the jar file from command file. Looks like I need to restructure my xml.
Also I have another question, when I run my project in Eclipse I see test-output directory gets created and all output files go in that. when I build in Maven and run the jar file from command line I do not see the output directory . Does it get created ?

⇜Krishnan Mahadevan⇝

unread,
Mar 29, 2016, 11:38:50 PM3/29/16
to testng...@googlegroups.com
>>>> when I build in Maven and run the jar file from command line I do not see the output directory . Does it get created ?
If you use maven to run the tests (using the surefire plugin) then your output directory is set to target/surefire-reports. The test-output folder is something that is created by the TestNG eclipse plugin.

If you are using Maven to build an uber jar [ A jar that contains all its dependencies ] and then using java -jar <yourJar.jar> to run your tests, then you would need to ensure that you provide a mechanism to pass in the test output directory. I am guessing that in this case, you are using TestNG APIs.


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Reply all
Reply to author
Forward
0 new messages