API Testing:



How To Generate Extent Reports Version 3 in Selenium WebDriver

Generate Extent Reports Version 3 in Selenium WebDriver

Earlier we posted “How To Generate Extent Reports” and in that post, we used version 2 of extent reports. This post will guide you on “How To Generate Extent Reports Version 3 in Selenium“. Extent reports are the advanced Selenium Reporting Tool.

Extent Reports Version 4 – Latest Version [2019]

By default, TestNG generates a report. A small note on how to generate reports using TestNG. Once you execute your tests, TestNG generates a test-output folder at the root of your project. It contains a detailed report and a summary report. But to get an advanced selenium report, you need to go for Extent Reports. If you still, want to see how TestNG Reports look like – click here to see the TestNG Report in Selenium

Now lets move on to advanced selenium reports i.e., Extent Reports.

Extent Reports Version 3

Pre-requisites to Advanced Selenium Reporting – Generate Extent Reports:

  1. Java should be installed (Link to Install and setup Java )
  2. TestNG should be installed (Link to Install TestNG )
  3. Extent Report Version 3 Jars – Download
  4. extent-config.xml – It allows to configure HTML Report

Steps To Generate Extent Reports:

  1. Firstly, create a TestNG project in eclipse
  2. Now download extent library files from the following link:
  3. Add the downloaded library files to your project
  4. Create a java class say ‘ExtentReportsClass’ and add the following code to it

Code explanation is clearly given in the earlier post “How To Generate Extent Reports Version 2


Refresh the project after execution of the above file. You could find an HTML file named “STMExtentReport.html” in your test-output folder. Copy the location of the STMExtentReport.html file and open it by using any browser. You could see beautiful high rich HTML reports as shown below.

Test Summary Report:

Graphical Report with PIE Charts:

Check this post to learn “How To Insert Captured Screenshots in Extent Reports

If you have any queries, please comment below. Like this post, don’t forget to share it.

Sharing is caring.

Share on facebook
Share on twitter
Share on linkedin

Like This Post?

We have a lot more where that came from?

We only send really good stuff occasionally, promise.

Rajkumar SM

28 thoughts on “How To Generate Extent Reports Version 3 in Selenium WebDriver”

  1. Hi Raj,

    Does Extent Report support multiple suite reports in a Single report.

    Say, I have 3 suites and all the 3 TestNG suites were in my pom.xml and I will be kicking the pom.xml for running my suites.

    My query is, I want to have all the tests info in a single Extent Report.

    public static void startReport() {

    String name = “C://Reports//TestAutomationResults -” + getDate();
    System.out.println(“HTML REPORT LOCATION IS :: ************* ” + name);

    extent = new ExtentReports(name + “.html”, false);

    extent.addSystemInfo(“Host Name”, “CABS”)
    .addSystemInfo(“Environment”, “QA”)

    extent.loadConfig(new File(System.getProperty(“user.dir”) + “\\extent-config.xml”));


    Please let me know If I am not clear

  2. Can this be used without TestNG project ? If so , can you please guide me .I am getting the error message “The method setSystemInfo(String, String) is undefined for the type ExtentReports”

      1. Hi Rajkumar ,

        I was able to fix that issue .My class name was also ExtentReports and hence was facing this issue .Once i renamed the class , it worked fine .
        I have two more questions :
        -> test..log(Status.PASS, MarkupHelper.createLabel(result, ExtentColor.GREEN));
        How to pass some more arguments in the above command . I want to show the Step Description and the Actual Result. Now it is allowing me to pass only one argument in addition to the status
        -> Time Taken in Dashboard is displayed in “ms” .Can we display that in hh:mm:ss format?

  3. Thanks Rajkumar for the response . Do have an idea about the 2nd query

    -> Time Taken in Dashboard is displayed in “ms” .Can we display that in hh:mm:ss format?

  4. Not getting where we need to put our test code in the extent report?
    In other words, I am not getting how can I get results of my tests?
    I am new to it and using page object framework (from toolsqa website). Can I use this extent report code for my page object structure?

    1. Hi Amit, you can use extent reports. Place @BeforeTest and @AfterMethod in your base class and call logger wherever it is necessary in your test scripts.

      1. Thanks Raj….its working now for individual tests (when running as TestNG), generating report successfully. 🙂
        Now tried a lot to run it for multiple tests, it’s not working. I had already changed @BeforeTest and @AfterTest to @BeforeSuite and @AfterSuite respectively.
        My TestNG is-

        When I ran it as a suite, 1st test get passed, 2nd gets failed and 3rd test gets skipped (all 3 tests contains same code of login, just replicas of each other) with no extent report gets generated.
        If I put Test1_TC at first place and SignIn_TC at second place, it gives same results (1st-passed, 2nd-failed, 3rd-skipped )
        Please help.

          1. ?class name=”testCases.SignIn_TC” /?
            ?class name=”testCases.Test1_TC” /?
            ?class name=”testCases.SearchaStore_TC” /?

  5. Hi,

    Thank you for your tutorial. It is extremely helpful. When I am executing Extent Reports. I am getting error message. See my code below.

    I tried posting the code. but I am unsuccessful.

      1. No, It is not getting created at that location. I have the correct code. But did you take a look at my code. I am getting a stack trace message. The location is specified correctly in the code. Something else is wrong. Maybe I am missing some jars.????

        1. You cannot pass location this way..
          htmlReporter = new ExtentHtmlReporter(System.getProperty(“user.dir”) + “C:\\selenium\\extent_reports\\STMExtentReport.html”);
          Change the above statement.
          htmlReporter = new ExtentHtmlReporter(System.getProperty(“user.dir”) + “/test-output/STMExtentReport.html”);

          1. I was able to fix my Issue. I did not all the JAR files installed in my eclipse. It is all working now.

            thanks in advance

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
API Testing eBook