Back to Browse

6. Extent Report With Multiple Classes

25.0K views
Mar 26, 2017
16:26

Please use the following link to install the Katalon Studio: https://katalon.com/sign-up?getr=krishnaRef Check Tubebuddy Features Here: https://www.tubebuddy.com/krishnasakinala Facebook : https://www.facebook.com/automationtesting2016/ Linkedin : https://twitter.com/krishnasakinala Google+ : https://plus.google.com/105286300926085335367 Twitter : https://www.linkedin.com/feed/?trk=hb_signin http://automationtesting.in/extent-report-with-multiple-classes/ Extent Report with Multiple classes will discuss about how to create a single report when you have multiple classes. Usually people will face issue that they will get the report with single class as all the extent reports related classes will be in the same class but when they have multiple classes then they might not get the single report for all the methods which are there in the different classes. To overcome this issue, we need to create a separate class to declare the extent reports related classes and need to extend that class to access the object of those classes in each class where we need to generate the report for the test methods. To show this, here we will create a class(i.e. BaseTest) to declare the extent reports related classes and will create 2 more classes(i.e. Functionality1 and Functionality2) to access these objects and will create a single report from these two classes. The most important thing here is, once you create an object to the extent report classes we need to access the same object in different classes for this we have declare these variables as static then all the instances share the same copy of that variable. And a class variable can be accessed directly with the class, without the need to create an instance. Below is the BaseTest class where we can declare the classes which are required to generate the extent reports and will configure the basic information for the report how it should generate. As we know that extent reports will use TestNG to generate the reports. Basic configuration is single time activity so we will put that code in @BeforeSuite and @AfterSuite annotations. And will run the code using testng.xml file as we need to run multiple classes at a time.

Download

1 formats

Video Formats

360pmp423.6 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

6. Extent Report With Multiple Classes | NatokHD