I have more than one test tags in my testng.xml
file that I am running using maven. I have set the parallel attribute at the suite level to methods and the thread-count as 5. The problem I am facing is that the tests are executed sequentially and only the methods inside the test cases are executed in parallel. To be more clear, though there are unused threads(Selenium nodes in the grid in my case) available the subsequent tests waits till all the methods in the previous test are executed.
Here is the testng.xml that i have used,
<suite name="Suite1" verbose="1" parallel="methods" thread-count="5" preserve-order="false">
<test name="Login" >
<classes>
<class name="testSuite.TestSet1" />
</classes>
</test>
<test name="Product Search">
<classes>
<class name="testSuite.TestSet2"/>
</classes>
</test>
</suite>
As I have more than 10 nodes available in my selenium grid, this behavior increases the execution time considerably and defeats the purpose of having a grid architecture. Please let me know if there's a way using which I can execute the test methods across the suite in parallel. I am sure that I am missing something silly, but could you please help me point that?
First allow your Suite to run "tests" in parallel with the number of test suites to run at a time (example 2).
Second allow your test to run "methods" parallel with the number of methods each can run (example 5 in each).
If you are bumping against the your thread limit be careful when adjusting these numbers. For example if you add another test group with thread-count of 5 and change your suite thread-count to 3. You'll now be at 15 threads.