Reputation: 133
I have a @Test testng method, which is receiving input from a Data Provider.
@Test (dataProvider = "createData")
public void testMethod(String id, String clientName){
//some code
}
I need to call the method from external code and pass in a third parameter (independent of DataProvider)
e.g. testMethod("ID887" "clientOne", rowNumber)
But this throws IllegalArgumentException, since the method is receiving only two parameters from DataProvider.
Can a method receive additional arguments?
Upvotes: 1
Views: 264
Reputation: 8396
...as per the documentation, you can use Guice to inject other variables, and it will work with TestNG.
http://testng.org/doc/documentation-main.html#dependency-injection
Upvotes: 1