I am using TestNG framework for my unit tests. Using DataProvider annotation, I am able to successfully pass input data from a CSV file to the test method.
The problem is I have several test methods in my test class, each requiring a different dataset as input for testing. All the inputs are present in a single csv file. I know I can specify a single input file by using the DataProvider annotation at class level. However, is there any way that each test case within the test file be run by using only specific data from the input CSV file?
Just to be more clear, my Test Class (say TestDemo) will have 3 test methods (say test1, test2, test3). There is a single CSV file with the test data for all 3 methods. Is there anyway I can specify this as the input file but run each test only with the data intended for that test?
Thanks in advance.