Avoid parallel execution between test classes

1,940 views
Skip to first unread message

Vinay

unread,
Feb 5, 2014, 11:55:39 PM2/5/14
to testng...@googlegroups.com
I am using TestNG to run tests on my source code. Please help me with the below 2 queries.

1) I have configured the testng.xml to run 2 other testng xml's. The testng xml looks like below:

<suite name="TestSuite">  
  <listeners>
  <listener class-name="com.listener.listenerlcass" />
  </listeners>
  <suite-files>
  <suite-file path="./testng-1.xml"></suite-file>
  <suite-file path="./testng-2.xml"></suite-file>
  </suite-files>
</suite>

testng-1.xml and testng-2.xml run test classes.

How do I ensure that that the test classes in testng-1.xml and testng-2.xml do not run parallely?

2) Further within testmg-1.xml, I have 2 test tags like something below:

<suite name="TestSuite1">
   <test name="Test1">
     <packages>
      <package name="com.pakcage1">
      </package>
     </packages>    
   </test>
   
   <test name="Test2">
     <packages>
      <package name="com.package2">
</package>
     </packages>     
   </test>  
</suite>

How do I ensure that that the test classes in com.package1 and com.package2 do not run parallely?

It would be very grateful if you could help me with this query.

Krishnan Mahadevan

unread,
Feb 6, 2014, 1:06:27 AM2/6/14
to testng...@googlegroups.com
Vinay,
First things first. To the best of my knowledge, TestNG doesnt support parallel execution of suites via the suite xml file. So your suites testng-1.xml and testng-2.xml are NOT going to be running in parallel.

The <suite> tag and the <test> tag has an attribute called "parallel". It accepts values such as "tests" (only applicable for suite tag) , "classes", "methods", "instances"

Feel free to pick whatever works for you from these set of values [ The values are pretty much self explanatory ]

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/


--
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 http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/groups/opt_out.

Vinay

unread,
Feb 6, 2014, 1:45:09 AM2/6/14
to testng...@googlegroups.com
Thank you Krishnan. That answers my queries.

Regards,
Vinay
Reply all
Reply to author
Forward
0 new messages