Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I'm trying to run WebDriver tests in parallel using testng.xml. I'm able to run testng tests in parallel by using parameter parallel="tests" but running with following paramters, "methods", "classes" is not working.

testng.xml

    <suite name="Suite1" verbose="1" parallel="methods" thread-count="5">
   <test name="Cart">
    <classes>
       <class name="com.tests1.Minus1">
       </class>       
    </classes>
   </test> 
  <test name="Checkout">
    <classes>
      <class name="com.tests2.AddA"/>
      <class name="com.tests2.AddB"/>
      <class name="com.tests2.AddC"/>
    </classes>
  </test>

  <test name="MBB">
    <classes>
      <class name="com.tests3.Mult1"/>
      <class name="com.tests3.Mult2"/>      
    </classes>
  </test>
</suite>

I tried with these versions 6.0.1, 5.9, 5.14.1, 6.3.1, 5.14.10, 5.10.0.1, 6.3, 5.14.6, 5.5. It didn’t seem to work. I also increased thread count to 100, but no behavior difference.

Can anyone please point out what I'm missing here?

Thanks

share|improve this question
    
What happens now? –  user246 Mar 20 '12 at 1:26
    
Does it also not work when you use "-parallel methods" from command line? –  Sam Woods Mar 20 '12 at 16:25
    
Actually I'm running these tests through Eclipse, so not using commandline. But I suspect that it won't run even through commandline. Right now, when I run tests they run sequentially instead of parallel if I use parallel=methods or parallel=classes. But runs in parallel for parallel=tests –  RatedAbstract Mar 20 '12 at 17:13
    
A wild guess, Can you keep attribute, parallel="methods" at the test level instead of suite level and check? –  Tarun Mar 20 '12 at 17:47
1  
This might help - groups.google.com/forum/?fromgroups#!topic/testng-users/… –  Tarun Mar 22 '12 at 6:18
show 2 more comments

2 Answers

Place this in your test or suite tag: preserve-order="false"

If this is not in there, parallel classes will not work.

share|improve this answer
add comment

I am not sure that I understand your goal. Using your testng.xml, when I ran with parallel='tests', each group of tests under a test tag ran sequentially, but the three test tags ran in parallel. Is that enough parallelism for you, or is your intent to run all six test classes simultaneously? If the latter, have you considered putting all six test classes under the same test tag?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.