0
votes

I have a TestNG Dataprovider with full of test data. I'm parsing an Excel sheet, so dataprovider has eg. 15 test data list.

I do not want to run my tests with all the 15 test data set, only one. Is it possible to filter the dataset and run the tests with that dataset only? For instance, let's run the test with id1 row. It is just an example, I'm going to store my data as a test object list.

@DataProvider(name = "testCaseSet1")
    public static Object[][] getTestData() {
        return new Object[][] {
                {"id1","testuser1", "test"},
                {"id2","testuser2", "test2"}
        };
    }
1

1 Answers

1
votes

One way would be to use:

@DataProvider(name = "testCaseSet1", indices = {0})