Question

Currently I have to know the no. of parameters I'm passing to the test function. Is there a way to pass parameters to the test function from the Data Provider as an array of indefinite number of elements? I'm reading rows of data from an excel sheet, and the idea is to execute each row as a separate test. I'm using testNG to run these tests.

Was it helpful?

Solution

Why not simply pass this parameter as an array? (which is in effect what the JVM does when you declare a varargs parameter)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top