Reputation: 43
I am using data provider to pass parameters in testng and want to print custom testcase name (it will be based on the type of data I am passing to the testcase). How do i do it?
Upvotes: 0
Views: 377
Reputation: 841
Parameters in Dataproviders looks like what you want.
If you declare your @DataProvider as taking a java.lang.reflect.Method as first parameter, TestNG will pass the current test method for this first parameter.
That bit of documentation also provides an example.
Upvotes: 1