dimanche 10 janvier 2016

Data Provider object and parallel test exclusion in testNG

I am using a data provider that initialize "x" with an increasing number to use with my @test. It means that the test will run once for every "x". I would like to run the test on parallel threads, so that it will take less time, for example: Running the same test in parallel on 10 browses). I have added the @DataProvider(name = "dataProvider", parallel = true) but it doesn't help and not seems to work at all.
Is there anther way to do this?

@DataProvider(name = "dataProvider", parallel = true)
public Object[][] xData() throws Exception {
    Object[][] result = new Object[31293][1];
    for (int x = 0; x < 31293; x++) {
        result[x] = new Object[]
                {x};
    }
    return result;
}

@Test(dataProvider = "dataProvider")
public void Requirement(int x) throws Exception {
System.out.println("Testing with x=" + x);
    }

Thanks!

Aucun commentaire:

Enregistrer un commentaire