Having a separate DataProvider class

In the preceding code, we have used a data provider in the same class. A data provider with the @DataProvider annotation can be used in a different class. The changes that need to be done are shown here.

The fact is that the change has to be done only at one place and that is in the @Test annotation as shown here:

@Test(dataProvider = "Data1" , dataProviderClass = ExternalProvider.class)

Next, we will see how to signal whenever any event happens. For this we use what are called TestNG Listeners.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.171.20