Whenever
we wanted to work with a different set of data for executing the same piece of test
cases. We need to parametrize our test case where we will pass multiple data to
the application at runtime.
Dataprovider
is a method for providing data to a test method. This annotated method must
return an Object[][] where each Object[] can be assigned the parameter list of
the test method.
The
@Test method that wants to receive data from this DataProvider needs to use a
dataProvider name equals to the name of this annotation.
Here in this example, I would be reading different set of data from excel file which is kept on my local and pass to the application.
Below
is the code snapshot where I would be reading data set from my excel file and
passing it to search on google home page.
This tutorial was very helpful. Thank You
Reply