mardi 26 mai 2015

How to retrive @Test method parameters in @DataProvider method?

I would like to retrieve parameters name of Test method in DataProvider method. By using method.getParameterTypes() in DataProvider, I am able to get the class of param being passed in Test method, but I want the names.

@Test
public void TC_001(String userName, String passWord){
//code goes here
}

@DataProvider
public Object[][] testData(Method method){
//Here I want to get names of param of test method i.e. userName and passWord
}

This is required because using these names I can get the data from my Excel file

Aucun commentaire:

Enregistrer un commentaire