![]() There is also the factory way where we create multiple instances of the test class with different constructor data. In order to know when we should use DataProvider, we also need to know a bit about the other method where we inject parameter values through testng.xml. TestNG supports two different ways of injecting parameter values. It allows the user to pass parameter values to the test method as arguments, so the test ends up running for each data-set passed in. One of the most important features of TestNG is its data-driven testing. Thus the test logic remains same but the data on which the test is run changes and this is called data-driven testing. Instead of hard coding the data set within tests itself, it will be more appropriate if we could pass our data as parameters to the test method. There are times when we would like to run our tests against different data sets.
0 Comments
Leave a Reply. |