0

I have a bunch of TestNG tests that run using a DataProvider as a bunch of parameters.

My Runner looks something like this:

   <methods>
     <include name="test1">
     <include name="test2">
   </methods>

So lets say if i have two parameters (param1 and param2) from the Dataprovider, the test executes in the following sequence:

test1 with param1
test1 with param2
test2 with param1
test2 with param2

Is there a way to make it run all test cases per parameter. i.e., the execution should be as follows:

test1 with param1 test2 with param1 test1 with param2 test2 with param2

Barett
  • 5,826
  • 6
  • 51
  • 55

1 Answers1

0

I think you will need 2 data providers.. makes you program better to understand and easier to expand...

TheLostMind
  • 35,966
  • 12
  • 68
  • 104
  • Thanks for the reply. Can you provide a little more details? I'm not sure how a second Data Provider should be implemented in this scenario – user2795054 Sep 23 '13 at 04:22
  • One way to do it would be.. make 2 different excel sheets for 2 different value sets.. and in your single data provider you can keep a static variable which says if(count ==1 or count==2) read from sheet1 , elseif (count ==3 or count ==4) read from sheet 2.. something like this... – TheLostMind Sep 23 '13 at 05:51