SELENIUM BASICS:


SELENIUM WEBDRIVER:


TESTNG:


REPORTS:


BUILD & CONTINUOUS INTEGRATION TOOLS:


CROSS BROWSER TESTING:


MOBILE TESTING:


AUTOMATION FRAMEWORKS:


API Testing:


INTERVIEW QUESTIONS:


SAMPLE RESUME:

Generate Extent Reports Version 3 in Selenium WebDriver | Advanced Selenium Reporting

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 Detailed report and 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: http://extentreports.relevantcodes.com/
  3. Add the downloaded library files in your project
  4. Create a java class say ‘ExtentReportsClass’ and add following code to it

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

extent-config.xml:

Refresh the project after execution of above ExtentReportsClassVersion3.java 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 forgot to share it.

Get our latest blog posts delivered to your inbox

Subscribe and get popular blog posts about software testing industry.

Rajkumar

28 thoughts on “Generate Extent Reports Version 3 in Selenium WebDriver | Advanced Selenium Reporting”

  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.

    @BeforeSuite
    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. How do we get Pass percentage in DashBoard??

  3. Configure Extent Report in Before and After Suites. That will work

    • Thanks Gurudatta

  4. 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”

    • Please post your code.

      • 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?

  5. 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?

  6. 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?

    • 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.
      Thanks,
      Rajkumar

      • 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.

        • testng.xml contains-

          • Hi Amit, replace < and > with ? in testng.xml and send…

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

          • Hi Amit, Send your project to rajkumarsmonline [at] gmail [dot] com

          • Hi Raj,
            Details shared on your email id. Please take a look and help.
            Thanks in advance.

  7. did you get my question listed ? I do not see my question listed?

    • Whats your question Asif

  8. 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.

  9. did you get a chance to look at my Issue.? I need help with this please. ????

    • Hi Asif

      • 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.????

        • 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”);

          • 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

  10. Hi ,

    How do i intergrate this with my test cases? can u please help.

    • Hi Sowmya, please go through the comments section, I have explained to someone earlier.

Leave a Comment

Share via
Copy link
Powered by Social Snap