I have following testng.xml, my project contains multiple classes each with one @Test testNG Method and its relevant Data Provider (means class I1_DoLoginTest contain one method and its dataprovider, class I2_CreateScenarioTest contain one method and its dataprovider and class I3_RunSimulationTest contain one method and its dataprovider)
Refer Structure of each of these 3 class very similar to this:
public class I1 {
@Test(priority = 1,dataProvider="dp_i1_Login")
public void I1_LoginTestCase(){
//Processing data from dataprovider given below
}
@DataProvider(name="dp_i1_Login")
public Object[][] dp_i1_Login() throws Exception{
//return fetching single row data in the form object array from excelsheet
//to be processed by test case
}
}
So basically I have class with dataprovider which provides one row data from at a time, each cell will be passed as a parameter to @Test method of same class and then control moves to next class that is I2_CreateScenarioTest and then I3_RunSimulationTest (Both I2_CreateScenarioTest and I3_RunSimulationTest have same structure as I1_LoginTestCase)
testng.xml structure is as:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite guice-stage="DEVELOPMENT" name="Default suite">
<test verbose="2" name="Default test">
<classes>
<class name="com.als.I1"/>
<class name="com.als.I2"/>
<class name="com.als.I3"/>
</classes>
</test> <!-- Default test -->
</suite> <!-- Default suite -->
My problem is execution sequence of all these 3 classes, I have picked 1 row from different excel sheets (refer structure of excel sheet here Excel Sheet)
For example if there are 2 rows in every sheet which provides data then, Current execution of testng suit(testng.xml) is like executing classes as I1-I1-I2-I2-I3-I3 but I want to execute classes like I1-I2-I3-I1-I2-I3.
single method executing its dataprovider's data twice as 2 rows in its respective sheet, but I need to move execution control to second class which is I2 as soon as class I1 reads and process 1st row from excel sheet, and similarly for class I2, I2 also process one row and move to I3 and this whole execution sequence(I1-I2-I3) should be repeat for second rows of their respective sheets, each row in each individual excel sheet collectively represent one test suit data, and second row in each individual excel sheet collectively represent second test suit data. I want execution of testng classes as I1-I2-I3-(for all rows 1)-I1-I2-I3-(for all rows 2) instead of I1-I1-I2-I2-I3-I3(row 1-row 2,row 1-row 2,row 1-row 2)