I want to run a test case multiple times. Is that configurable in the testng.xml? If I add a loop in the test method, then the results of each run will not be a
public class ProcessTest implements ITest {
protected ProcessData processData;
@Test
public void executeServiceTest() {
System.out.println(this.processData.toString());
}
@Factory(dataProvider = "processDataList")
public RiskServiceTest(ProcessData processData) {
this.processData = processData;
}
@DataProvider(name = "processDataList", parallel=true)
public static Object[] getProcessDataList() {
Object[] serviceProcessDataList = new Object[10];
for(int i=0; i<=serviceProcessDataList.length; i++){
ProcessData processData = new ProcessData();
serviceProcessDataList[i] = processData
}
return serviceProcessDataList;
}
@Override
public String getTestName() {
return this.processData.getName();
}
}
By using @Factory and @DataProvider annotation of TestNG you can execute same test-case multiple times with different data.