vendredi 22 avril 2016

Run data provider tests in parallel using testng

I've tests with data provider. Following is the sample code:

@DataProvider(name = "testData")
public Object[][] testData(){
    return new Object[][]{
        {"John", "San Jose"},
        {"Mike", "Santa Clara"}
    };
}

@Test(dataProvider = "testData")
public void verifyCity(String name, String city){
   System.out.println("Name: " + name + " city: " + city);
}

In this code, I've to run each test in parallel. I'm not using testng.xml file. How can I achieve parallelism by making changes at test method level itself?

Aucun commentaire:

Enregistrer un commentaire