Skip to content

Instantly share code, notes, and snippets.

@basilboli
Created October 29, 2013 10:43
Show Gist options
  • Save basilboli/7212357 to your computer and use it in GitHub Desktop.
Save basilboli/7212357 to your computer and use it in GitHub Desktop.
Running tests in parallel with testng
/**
* Running tests in parallel with testng.
**/
//Generate tests to be run in parallel
//Important! see paralell=true
@DataProvider(name = "dataProvider", parallel = true)
public Object[][] generateTets() throws Exception {
//define number of threads to be used, default is 10
System.setProperty("dataproviderthreadcount", "20");
return TestGenerator.generateTests();
}
/**
* Note : we are using testNg dataProvider annotation to run parametrised tests
*/
@Test(dataProvider = "dataProvider")
public void test() {
......
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment