Created
October 29, 2013 10:43
-
-
Save basilboli/7212357 to your computer and use it in GitHub Desktop.
Running tests in parallel with testng
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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