• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Programming Languages
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials
  • Automation Tools and Different Tools
    • Web Automation
      • Selenium with Java
        • Selenium Basic
        • Selenium Advance
        • Selenium Realtime
        • Framework
        • Selenium Interview
        • Selenium Videos
        • Selenium with Docker
      • Selenium with Python
      • WebdriverIO
        • Selenium Webdriver C# Tutorial
      • Cypress
      • Playwright
    • TestNG
    • Cucumber
    • Mobile Automation
      • Appium
    • API Testing
      • Postman
      • Rest Assured
      • SOAPUI
    • testRigor
    • Katalon
    • TestProject
    • Serenity BDD
    • Gradle- Build Tool
    • RPA-UiPath
    • Protractor
    • Windows Automation
  • Automation For Manual Testers
  • Services
  • Online Training
  • Contact us
  • About me
  • Follow us
    • Linkedin
    • Facebook Group
    • Facebook Page
    • Instagram

Automation

Selenium WebDriver tutorial Step by Step

You are here: Home / Advance Reporting / Advance Selenium Reporting with Screenshots

Advance Selenium Reporting with Screenshots

May 25, 2015 by Mukesh Otwani 110 Comments

Advance Selenium Reporting 6

Before moving to actual post hats off to the developer who actually developed this jar for advanced reporting.

You must be wondering that why we need custom reporting because till now we have covered so many type of reporting like Default reporting by TestNG and XSLT report via ANT.

Version 2 is updated. Kindly use new version 2 for new features.

Before moving to this article lets see what exactly we will get.

 

Watch youtube video for the same

Advance Selenium Reporting with screenshot
Advance Selenium Reporting with screenshot

 

Advance Selenium Reporting

Advance Selenium Reporting

 

 

Advance Selenium Reporting Advance Selenium Reporting 3

 

Advance Selenium Reporting 4

 

Advance Selenium Reporting 6

 

How to generate Advance Selenium Reporting

Check out the below article if you have not covered during previous post.

Default report in Selenium using TestNG

Generate XSLT report via ANT

I loved this reporting which allows me generate log inside report and we can attach screenshot as well at run time and some other features as well.

Features of Extent Report

  • Allow is to generate logs inside HTML.
  • Generate PIE Chart based on test case status.
  • Generate Step summary.
  • We can filter reports depends on status.
  • It provides execution history.
  • It fetches system details like OS, Java Version, and Memory and so on.
  • Allow us the attach screenshot in report that is most important feature.

 

Download

1- Open any browser

2-Navigate to below url and click on download link to get jar file which we have to add into our project to get Custom report.

url – http://extentreports.com/

 

Advance Selenium Reporting

After downloading you will get a zip file which you have to unzip. After unzipping you will get a jar file which we have to add into our project.

Advance Selenium Reporting

 

If you are new to eclipse and don’t know how to add jars then check below post which helps you to get familiar which Eclipse IDE

Eclipse tips and tricks

 

Program for Advance Selenium Reporting

Now we are done with configuration so let’s see how we can generate reports via extent report

package demo;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

import org.testng.Assert;

import org.testng.annotations.Test;



import com.opera.core.systems.scope.services.Exec;

import com.relevantcodes.extentreports.ExtentReports;

import com.relevantcodes.extentreports.LogStatus;



public class AdvanceReporting {





     @Test

     public void verifySeleniumBlog(){



           // Create object of extent report and specify the Class name in get method

           // in my case I have used AdvanceReporting.class

           ExtentReports extent = ExtentReports.get(AdvanceReporting.class);



           // Call init method and specify the location where you want to save this report

           // second parameter is set to true it means it will overwrite report with new one

           extent.init("C:\\Mukesh\\Report\\myreport.html", true);



           // Start Test

           extent.startTest("Verify Page Title");





           // Start browser

           WebDriver driver=new FirefoxDriver();

           driver.manage().window().maximize();

           extent.log(LogStatus.INFO, "Browser started");



           // Open application

           driver.get("https://learn-automation.com");

           extent.log(LogStatus.INFO, "Navigated to www.learn-automation.com");



           // get title

           String title=driver.getTitle();

           extent.log(LogStatus.INFO, "Get the current title");



           // Verify title

            Assert.assertTrue(title.contains("Selenium"));

            extent.log(LogStatus.PASS, "Title verified");



            // In case you want to attach screenshot then use below method

            // I am taking random image but you have to take screenshot at run time and specify the path

            extent.attachScreenshot("C:\\Mukesh\\image1.jpg");



            // Close application

            driver.quit();

            extent.log(LogStatus.INFO, "Browser closed");



            // close report

            extent.endTest();



     }



}

After execution you can check report in path which you have mentioned in program.

Output/ Sample report

Advance Selenium Reporting 6

 

In above program you have to add code for screenshot which will be added in reports.

Check out the below post how we can capture screenshot and how to create reusable action to reuse code.

How to take screenhsot in Selenium

It is very good and fast plugin/jar so can not cover all in one shot so you can check documentation of as well and try to explore as much possible.

Link for documentation- http://relevantcodes.com/ExtentReports-documentation/

Soon I will be creating part 2 of above post.

If you like this post and if you feel its informative then please comment below and share with others as well.

Keep visiting, have a nice day 🙂

For More updates Learn Automation page

For any query join Selenium group- Selenium Group

Filed Under: Advance Reporting Tagged With: Advance Selenium Reporting, Graph and Pie Chart

Reader Interactions

Comments

  1. Archana says

    March 19, 2020 at 4:32 PM

    Hi Mukesh,

    How to use extent report in POM? Can you please explain with multiple classes?

    Reply
    • Mukesh Otwani says

      March 21, 2020 at 7:35 PM

      Hi Archana,

      In Page Object Model, it is always better if you implement Extent Reporting with TestNG Listener. Use ITestListener interface for this purpose.

      Reply
  2. komal says

    January 23, 2020 at 5:24 PM

    Hi ,

    http://extentreports.relevantcodes.com/ This URL is not working how to download JAR file.

    Reply
    • Mukesh Otwani says

      January 23, 2020 at 5:38 PM

      Hi Komal,

      This is latest extent report link http://extentreports.com/
      From this link, download from jar links https://mvnrepository.com/artifact/com.aventstack/extentreports/3.1.5

      Reply
  3. Trisha says

    July 2, 2019 at 2:42 PM

    Hi Mukesh can you tell me how to use this extent report using junit?

    Reply
    • Mukesh Otwani says

      July 2, 2019 at 10:03 PM

      Hi Trisha,

      Just like annotations of TestNG, you can use JUnit annotations as per your test script requirement. I would recommend you to use TestNG because it is more advanced than JUnit

      Reply
  4. Sai Prathyusha says

    May 22, 2019 at 12:30 PM

    Hi Mukesh,
    I am using extent report on an advanced level by attaching screenshots. But now I have to test in multiple browsers and like to report in extent reports only. Is there any way to represent extent report in multiple browsers result like TestNg report.

    Reply
    • Mukesh Otwani says

      May 22, 2019 at 3:01 PM

      Hi Prathyusha,

      Are you running tests in parallel if so then you have to use ThreadLocal class to wrap ExtentTest object so that each ExtentTest object remains thread safe.

      Reply
  5. Sandeep Srivastav says

    February 20, 2017 at 7:45 PM

    Hi Mukesh,

    I have tried the above code and I am getting Access Denied for the location where I want to store the report.
    I have tried various drives but I am stuck on Same Access Denied issue. Can you please help

    Reply
    • Mukesh Otwani says

      February 21, 2017 at 11:55 AM

      Hi Sandeep,

      Try to save screenshot in logged in user folder

      Reply
  6. Dawood Ayyash says

    February 6, 2017 at 6:39 PM

    when i open cmd
    and enter
    ant -version
    the command prompt shows this massge
    “java.exe “”is not recognized as an internal or external command operabke program or batch file”

    Reply
    • Mukesh Otwani says

      February 7, 2017 at 6:26 AM

      Hi Dawood,

      You dont need ANT to run this report you can configure extent report and use it. To run ANT or MAVEN you need to set Java path as well.

      Reply
  7. Guri says

    January 19, 2017 at 11:26 PM

    Hi Mukesh, I had a quey that I have been asked to log the logs in text as well and i am using extent reports which has default logging feature… pls suggest views on it

    Reply
    • Mukesh Otwani says

      January 20, 2017 at 2:26 PM

      Hi there,

      It all depends on your project requirements whether you need logs from log4j or putting logs into extent report. Extent report is for showing report to client in a contemporary way while logs in text file is primitive.

      Reply
  8. Prashant Masekar says

    January 17, 2017 at 9:41 AM

    Hi mukesh,

    I have downloaded 2.41.2 version and i am getting error on get method(The method get(Class) is undefined for the type

    Please give suggestion. Thanks

    Reply
    • Mukesh Otwani says

      January 19, 2017 at 2:06 PM

      Hi Prashant,

      It is better if you use latest version of Selenium Webdriver, at least 2.53.0

      Reply
  9. Prashant Masekar says

    January 17, 2017 at 9:40 AM

    Hi mukesh,

    I have downloaded 2.41.2 version and i am getting error on get method(The method get(Class) is undefined for the type

    Please give suggestion. Thanks

    Reply
    • Mukesh Otwani says

      January 19, 2017 at 2:40 PM

      Hi,

      Please refer part 2 for new syntax

      Reply
  10. Kapil Kapoor says

    January 16, 2017 at 9:18 AM

    Hi Mukesh,
    Hope you doing well
    I am using extent report and printing the content for Finnish language. The data is getting replaced with blocked characters rather printing the actual value, In short I guess extent report is not supporting the char set.
    Could you please help with this issue.
    Thanks
    Kapil Kapoor

    Reply
    • Mukesh Otwani says

      January 24, 2017 at 5:00 PM

      Hi Kapil,

      This one I am not sure may be you can check with Anshu arora who developed extent report.

      Reply
  11. Deb says

    November 29, 2016 at 12:10 PM

    Hi Mukesh,

    I am getting broken UI for the HTML report.
    Can you please suggest how that can be fixed.

    Reply
    • Mukesh Otwani says

      November 30, 2016 at 5:09 PM

      Hi Deb,

      Kindly try version 2

      Reply
      • Deb says

        December 1, 2016 at 9:23 AM

        I have tried version 2.40.2 and 2.05, the issue persists for both. Is there something else that I am missing.

        Reply
        • Mukesh Otwani says

          December 6, 2016 at 2:17 PM

          try with 2.41

          Reply
  12. rajesh says

    November 8, 2016 at 1:12 PM

    I did same as per your steps but i am not getting the report format and it is showing simple report format,I think you are hiding some code to generate in this format.Please help how to generate this particular format report in extent

    Reply
    • Mukesh Otwani says

      November 8, 2016 at 2:28 PM

      Rajesh, you have to follow part 2 not this post.
      Kindly refer below post and mention error also if any.

      http://learn-automation.com/advance-selenium-reporting-with-screenshots-2/

      Reply
  13. rajesh says

    November 5, 2016 at 6:58 PM

    Hi Your code is not working because there is no get method in ExtentReport’s provide complete proper explanation,most of the sites are providing half of the information and we are unable to get addscreenshot method in extent .

    Reply
    • Mukesh Otwani says

      November 5, 2016 at 9:37 PM

      Hi Rajesh,

      I guess you have not gone through complete article. I have mentioned that version 2 is available so you can refer new version

      http://learn-automation.com/advance-selenium-reporting-with-screenshots-2/

      Kindly go throw it and let me know if any issue.

      Reply
  14. Omphile Mokgoamme says

    November 1, 2016 at 7:18 PM

    Hi Mukesh

    I put my screenshots in the shared folder but my other colleagues still cannot view the screenshots.
    Please advise.

    Reply
    • Mukesh Otwani says

      November 4, 2016 at 1:53 AM

      Hi Omphile,

      Can you see screenshot in report in your local machine?

      Reply
  15. Moreno says

    September 27, 2016 at 9:13 AM

    Hi Mukesh, your tutorials are really great help

    Just a question, when will we use XSLT Reporting over Extent Reporting (or vice versa)? Is there a huge advantage to use the one over the other? I am new to this topic about automation reporting. Should I implement both on my project? Thanks ahead Mukesh

    Reply
    • Mukesh Otwani says

      September 29, 2016 at 10:53 AM

      Hi Moreno,

      You can use any one of it. I use extent report because It allows me to add screenshots as well.

      Reply
  16. Vadim Z. says

    September 17, 2016 at 12:38 AM

    Hi, very great job. I have just one questions – do you have any option to combine several reports / iterations into one report. Not overwrite, but contine

    Reply
    • Mukesh Otwani says

      September 29, 2016 at 2:40 PM

      Yes Vadim, you can use EXTENT X report for this. I have not tried yet but it is possible.

      Reply
  17. Abhinav says

    August 24, 2016 at 2:30 PM

    Hi Mukesh I have created the object of Extentreports extent. But I am getting error when I try to execute ExtentReports.get(Completeflow.class). It is showing error on get method and saying the method get is undefined for the ExtentReports.

    Reply
    • Mukesh Otwani says

      August 27, 2016 at 11:09 PM

      Hey Abhinav,

      Kindly refer new doc

      http://learn-automation.com/advance-selenium-reporting-with-screenshots-2/

      Reply
      • Abhinav says

        September 1, 2016 at 3:17 PM

        Hi Mukesh

        Now it is working fine
        Thanks for the help.

        Reply
        • Mukesh Otwani says

          September 2, 2016 at 5:56 PM

          Great Abhinav

          Reply
  18. harmeet says

    July 22, 2016 at 12:44 PM

    Hi Mukesh,

    I am writing my logs to a text log file. Is there a way to read it and convert into HTML report.

    Reply
    • Mukesh Otwani says

      July 25, 2016 at 12:15 PM

      Hi Harmeet,

      In extent report all logs by default is coming in HTML format. You can use latest version of extent report.

      Here is the link http://learn-automation.com/advance-selenium-reporting-with-screenshots-2/

      Reply
  19. MINNU JAYAPRAKASH says

    July 15, 2016 at 2:34 PM

    hello…can we use this extnd report for testNG?????

    Reply
    • Mukesh Otwani says

      July 20, 2016 at 2:14 PM

      Hey Minnu,

      Yes we can use this with TestNG.

      Reply
  20. MINNU JAYAPRAKASH says

    July 15, 2016 at 1:30 PM

    hello sir,

    i want 2 know this extnt reporter wil work only in maven or testng also??can u reply

    Reply
    • Mukesh Otwani says

      July 20, 2016 at 2:15 PM

      Yes will work with Maven and TestNG too.

      Reply
  21. MINNU JAYAPRAKASH says

    July 15, 2016 at 9:50 AM

    hello,,i installed Extent Report .but it shows error.For get the idea of this,,am using ur sample pgms and jars……it showing “Error: Could not find or load main class com.selenium.test.Reportlog
    “.in sample pgm…error in the ” ExtentReports extent = ExtentReports.get(AdvanceReporting.class);”

    ” extent.log(LogStatus.INFO, “Browser started”);”

    ” extent.log(LogStatus.INFO, “Navigated to http://www.learn-automation.com“);”

    Reply
    • Mukesh Otwani says

      July 20, 2016 at 2:20 PM

      Hi Minnu,

      You have to use version 2 now.

      http://learn-automation.com/advance-selenium-reporting-with-screenshots-2/

      Reply
  22. praveen says

    July 8, 2016 at 5:20 PM

    Hi mukesh,

    I am taking screenshot on failure of the step, but in report the screenshots are not visible
    only a small image icon is coming . Even after clicking on the image , nothing is visible.

    Is there is any setting I need to do before execution.

    Reply
    • Mukesh Otwani says

      July 9, 2016 at 11:03 AM

      Hi Praveen,

      Check image path

      Reply
  23. praveen says

    July 8, 2016 at 5:20 PM

    Hi mukesh,

    I am taking screenshot on failure of the step, but in report the screenshots are not visible
    only a small image icon is coming . Even after clicking on the image , nothing is visible.

    Reply
    • Mukesh Otwani says

      July 12, 2016 at 4:55 PM

      Hey Praveen,

      Kindly check screenshot path if path is invalid then you get cross mark instead of image.

      Reply
  24. Paramjeet says

    July 5, 2016 at 1:22 AM

    Hi Mukesh,
    I have downloaded the latest version 2.41.1 and same i have added in referenced libraries (extentreports-java-2.41.1) , now when i am writing first line to extent reports then it’s showing error in get method and after mouse howering it’s displaying error like the method get(class ) is undefined for the type ExtentReports

    ExtentReports extent = ExtentReports.get(verifyselReport.class);
    WebDriver driver= new FirefoxDriver();

    Please revert on this.
    Thanks & Regards,
    Paramjeet

    Reply
    • Mukesh Otwani says

      July 8, 2016 at 11:32 AM

      Hey Paramjeet,

      Kindly refer below post for 2.41 http://learn-automation.com/advance-selenium-reporting-with-screenshots-2/

      Reply
  25. Rupali says

    June 30, 2016 at 2:07 AM

    Hi Mukesh,

    How can we email Extent Reports daily automatically after test case execution completes?Can please share the code?

    Reply
    • Mukesh Otwani says

      June 30, 2016 at 8:20 AM

      Hi Rupali,

      In this case you need to write email code and this code you can run once your execution is done.

      Reply
      • Rupali says

        July 16, 2016 at 12:37 AM

        Hi Mukesh,

        I am saving extent reports in my local machine at location C:\\ReportsExtent\\ReportsExtent.html. Is it possible to send this html report in email or do I need to convert it to pdf or any other format?

        Also is it possible that extent report is emailed in proper format with error screenshot through jenkins after every build is run. If you share any post regarding sending customized reports via jenkins then it would be of great help.

        Reply
        • Mukesh Otwani says

          July 20, 2016 at 2:10 PM

          Hi Rupali,

          First Answer- Yes you can send email with report kindly check below post.
          http://www.assertselenium.com/java/emailable-reports-for-selenium-scripts/

          Second- In jenkins you can add plugin which will help you to send custom email.
          Plugin- Email-ext plugin
          http://www.nailedtothex.org/roller/kyle/entry/articles-jenkins-email

          Reply
  26. shobhit says

    June 15, 2016 at 10:23 PM

    Hi Mukesh,

    Thanks for this tutorial.

    I have couple of questions –
    1- Do we need to configure extent report in every testng class ?
    2- When I am using [ logger.init(“D:\\Extent.html”, true); ] in individual testNG class, then only latest testcase is getting record in extent report, please suggest how we can capture all the cases (@Test) in extent report.

    Thanks,

    Reply
    • Mukesh Otwani says

      June 20, 2016 at 12:15 PM

      Hi Shobhit,

      Answer

      1- yes or else you can use listener to do this.
      2- Kindly refer version 2 since version 1 is deprecated now.

      Reply
  27. pankaj says

    June 11, 2016 at 12:17 PM

    Hi
    Mukesh
    I want to used Extent report in my framework .I work on Hybridframework .
    I add the extent report in test Configuration Package class where launching of browser ,loading of url are take place but it not work it so null pointer exception in precondition browser is launching but url is not loading how to solve it.And also suggest me how to i add generic function for Extent report in my framework that work for every test scripts run.

    Reply
    • Mukesh Otwani says

      June 14, 2016 at 9:16 PM

      Hi Pankaj,

      Kindly refer new article http://learn-automation.com/advance-selenium-reporting-with-screenshots-2/

      Reply
  28. Rajesh k says

    June 8, 2016 at 6:22 PM

    Hi ,

    I want to know how to pass screen shot path dynamically after taking screen shots in this code
    extent.attachScreenshot(“C:\\Mukesh\\image1.jpg”);

    please provide the code i want it should be dynamic.

    .

    Reply
    • Mukesh Otwani says

      June 9, 2016 at 1:48 AM

      Hi Rajesh,

      Kindly refer my screenshot video and advanced refer part 2. I have covered the same.

      Reply
  29. Keerthi says

    May 27, 2016 at 1:17 PM

    Hi Mukesh,

    I am using extent reports 2. I am able to attach screenshots in the report. But when I share the report to others they are not able to see the screenshots in the report. How to resolve this issue.

    Reply
    • Mukesh Otwani says

      May 30, 2016 at 12:37 AM

      Hi Keerthi,

      Keep screenshots in shared folder.

      Reply
  30. pavan kumar says

    May 20, 2016 at 11:25 PM

    Hi Mukesh,
    HatsOff to your effort for creating of nice posts which are usefull for beginners and who are willing to move there carrier to forward.
    currently i am working with jenkins and i would like to generate reports using extent reports plugin. Like to see with screenshots in jenkins Dashboard (or) from new tab.could you please guide me the configuration ? Or else ,,If you create a post on this, it would be more benefit for the users who are following in this site.

    Thanks in Advance
    pavan kumar D

    Reply
    • Mukesh Otwani says

      May 21, 2016 at 1:15 AM

      sure will try to upload post on the same.

      Reply
  31. Kumar says

    April 15, 2016 at 1:22 PM

    HI Mukesh,

    The latest report will generate report at hte end of the execution by calling flush method.But incase my execution stops halfway due to error what happens to the report then.Can you suggest me the way to generate.I believe 1.41 version report generates the very first step we call it.

    Thanks,
    Kumar

    Reply
    • Mukesh Otwani says

      April 18, 2016 at 11:51 PM

      Hi KUmar,

      Kindly refer http://learn-automation.com/advance-selenium-reporting-with-screenshots-2/

      Reply
  32. Cannes says

    March 16, 2016 at 2:08 PM

    driver.get(“http://www.google.com”);

    extent.log(LogStatus.INFO, “Navigated to Google”);

    String title=driver.getTitle();

    Assert.assertTrue(title.contains(“Selenium”));

    extent.log(LogStatus.PASS, “Title verified”);

    If status is Fail. the execute will just stop here and not updated the LogStatus to Fail. How can I set if True log Pass, else log Fail?
    Thanks

    Reply
    • Mukesh Otwani says

      March 20, 2016 at 7:42 PM

      Hi Cannes,

      you have to use try catch in this case.

      Reply
  33. Gaurav says

    February 1, 2016 at 6:48 PM

    I want to get a report for all my test cases together , currently I am getting it for that single test case , How can i get it for all 40 my test cases , Please guide

    Reply
    • Mukesh Otwani says

      March 3, 2016 at 4:23 PM

      Hi Gaurav,

      Please follow below link for the same.

      http://extentreports.relevantcodes.com/java/version2/docs.html#parallel-classes

      Reply
  34. vasudeo says

    January 19, 2016 at 12:55 PM

    I am struggling to add reports in jenkins

    Could you please share the steps here.

    Reply
    • Mukesh Otwani says

      January 20, 2016 at 1:08 AM

      Hi vasudeo,

      We have TestNG plugin in Jenkins which will generate report with Dashborad. PLease check and try the same

      Reply
  35. Loren Lai says

    January 14, 2016 at 6:52 PM

    Hi Mukhes,

    first of all thank you so much for your TestNG tutorial. I have learnt so much from that. 😉
    Anyway, I’m still a newbie and I have a question regarding the “ExtentReports”, please.

    As described about in your tutorial I have downloaded the JAR package “extentreports-2.40.0” and add all the JAR files into my ECLIPSE environment.
    Then I copy the CODE from your example (Program for Advance Selenium Reporting) listed above, but somehow I got some issues.

    Eclipse said that … “The method get(Class) is undefined for the type ExtentReports”

    ExtentReports extent = ExtentReports.get(TestNGExample.class);

    Eclipse said that … “The method init(String, boolean) is undefined for the type ExtentReports”

    extent.init(“C:\\MYARCHIVES\\myreport.html”, true);

    Eclipse said that … “The method log(LogStatus, String) is undefined for the type ExtentReports”

    extent.log(LogStatus.INFO, “Browser started”);

    etc.

    It seems that “extent” is unknown due to this issue at the first line

    Eclipse said that … “The method get(Class) is undefined for the type ExtentReports”

    ExtentReports extent = ExtentReports.get(TestNGExample.class);

    Could you help, please? Because I really like to run this report.

    Thank you very much in advance.

    Cheers
    Loren

    Reply
    • Mukesh Otwani says

      January 17, 2016 at 12:01 AM

      Hi Loren,

      Thanks for nice comment.

      is this issue solved?

      Reply
      • Giridhar says

        March 10, 2016 at 2:39 PM

        Hi Mukesh,

        Even i am facing the same issue.

        ExtentReports extent = ExtentReports.get(Reporting.class);
        The method get(Class) is undefined for the type ExtentReports

        Regards,
        Giridhar B S

        Reply
        • Mukesh Otwani says

          March 11, 2016 at 6:28 PM

          Hi Grirdhar,

          Please use the latest version 2 which will resolve your issue.

          Reply
  36. Rakesh Boddu says

    January 13, 2016 at 6:03 PM

    Hi Mukesh,

    I have downloaded jar file version ExtentReports Java 2.40 (6044) and i have added to my project successfully.
    when i add this line “ExtentReports extent = ExtentReports.get(DocsHomePage.class);” i get error for .get method and i have imported all the things below:

    import com.opera.core.systems.scope.services.Exec;
    import com.relevantcodes.extentreports.ExtentReports;
    import com.relevantcodes.extentreports.LogStatus;

    Can you please tell me how to get rid of this error saying “The method get(Class) is undefined for the type ExtentReports”

    Reply
    • Mukesh Otwani says

      January 17, 2016 at 12:04 AM

      Hi Rakesh,

      You are using extent report version 1 code.

      Please use version 2 code

      Reply
  37. Brijendra Singh says

    January 11, 2016 at 10:03 PM

    while using this ExtentReports extent = ExtentReports.get(XSLTReport.class);
    i am getting compile time error on get method.please suggest

    Reply
    • Mukesh Otwani says

      January 12, 2016 at 6:39 PM

      Use version 2 new jars.

      Reply
      • Dheemanth says

        April 7, 2016 at 12:32 PM

        Hi mukesh, Even after using the latest version of Extentreport ,i am facing the problem when i add this line “ExtentReports extent = ExtentReports.get(Demomaven.class);” i get error for .get method and also for init method.
        can you please tell how to come out of this problem?

        Reply
        • Mukesh Otwani says

          April 10, 2016 at 12:20 PM

          Hi Dheemanth,

          Please follow download steps carefully and run again.

          http://learn-automation.com/advance-selenium-reporting-with-screenshots-2/

          Reply
  38. Aaron says

    January 6, 2016 at 12:44 AM

    Ahh i think i figured it out, i have to init the report as a db report and it seems to work…. awesome!

    Reply
    • Mukesh Otwani says

      January 6, 2016 at 12:45 AM

      Great Aaron Cheers 🙂

      Reply
  39. Aaron says

    January 6, 2016 at 12:28 AM

    Hi Mukesh,

    I love the Extent Reports and I just recently implemented the Extent Merge. However i see that extent merge is not including the screenshots from the merged reports. Is this something that has not been included yet in Extent merge? I noticed the ExtentMerge report doesn’t even reference the screenshot but only a blank td as seen below…


    17:47:26

    Thank you.

    Reply
    • Mukesh Otwani says

      January 6, 2016 at 12:47 AM

      Hi Aaron,

      Even I have implemented version 2 in my previous project and My manager loved it 🙂

      Reply
  40. Guruprasad says

    December 31, 2015 at 12:24 PM

    Hi Mukesh, i tried the above example of verifying the blog title.
    I get the below error when i run it.

    Dec 31, 2015 12:06:15 PM com.relevantcodes.extentreports.Configuration
    INFO: Configurating report from file:/D:/Selenium/extentreports-2.40.0/extentreports-java-2.40.0.jar!/com/relevantcodes/extentreports/resources/extent-config.xml

    FAILED CONFIGURATION: @AfterMethod tearDown([TestResult name=VerifyBlogTitle status=FAILURE method=VerifyTitle.VerifyBlogTitle()[pri:0, instance:selenium.mukesh.extentreport.VerifyTitle@740cae06] output={null}])
    java.lang.NullPointerException
    at selenium.mukesh.extentreport.VerifyTitle.tearDown(VerifyTitle.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:786)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    at org.testng.TestRunner.run(TestRunner.java:617)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
    at org.testng.TestNG.run(TestNG.java:1057)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

    Reply
    • Mukesh Otwani says

      January 2, 2016 at 10:43 PM

      Hi Guru,

      There is some issue with current version of jars.

      PLease download below zip file and extract file then add all jars and add into project.

      http://relevantcodes.com/wp-content/plugins/download-monitor/download.php?id=17

      Run the test again and let me know if you still facing the same issue.

      Reply
  41. Rohit says

    December 14, 2015 at 1:25 PM

    But When I was added in test.log(LogStatus.ERROR() ) this method said that this logs are not associate with any class so how do I do this please let me know.

    Reply
    • Mukesh Otwani says

      December 14, 2015 at 10:10 PM

      Hi Rohit please use version 2 then this issue wont come.

      Reply
  42. Manohar says

    December 11, 2015 at 11:28 PM

    Hi Mukesh,
    I am following your blog, your explanation is very good. Recently i have seen one video related to extentreport, there you have shown with only one test(@Test). I am little confusion to write for 2 or more @test blocks in same class.
    If i want to execute two different classes, each class has more than 2 @Test blocks. So can you share the code how to implement for this type of scenarios.

    Reply
    • Mukesh Otwani says

      December 12, 2015 at 3:41 PM

      Hi Manohar,

      Thanks 🙂 Please find the below link which will help you out.

      http://extentreports.relevantcodes.com/java/version2/docs.html#parallel-classes

      Try this and let me know if any issue.

      Happy weekend

      Reply
  43. Rohit says

    December 11, 2015 at 7:28 PM

    Hello MukeshJi,

    Could you please tell me how do I attach Log4j logs to the Extent Report Logs?
    all my Scripts having different classes like for Element locators , for logs , for test scripts and other utilities as well.
    Please suggest me what to do fro this.

    Awaiting………………

    Reply
    • Mukesh Otwani says

      December 12, 2015 at 3:46 PM

      Hi Rohit,

      Actually,extent report internally use Log4j so i will recommend to add logs into reports only.

      Hope its clear.

      Reply
  44. suresh says

    December 11, 2015 at 1:18 PM

    Hi Mukesh,

    I have one doute, I m using page object model and input data reading excel all methods cal to main class(for ex we have 20 methods in different classes those methods cal to main class to End to End testing) how to implement extent reports.(if u any code please send me my email).

    Reply
    • Mukesh Otwani says

      December 12, 2015 at 3:50 PM

      Hi Suresh,

      I can guide you how you can achieve this.

      Use @BeforeTest and keep initialise part into it and inside @Test use logger of extent test.

      Reply
  45. Sachin Pathare says

    December 8, 2015 at 11:00 AM

    Hi,

    How we can create a report of multiple test script beucause when we use report.init(“./target/AdvanceReport.html”, true); it is overrting previous test report and and shown only 1 test case result. is there any way to get result of all test cases run in single ran session. also rather thatn writing the path for report.init() in every test case can we write in single and it will generate the report of all scripts which we had ran.

    Thanks,
    Sachin

    Reply
    • Mukesh Otwani says

      December 8, 2015 at 9:56 PM

      Hi Sachin,

      In init method if you set to false it will not overrite your report but in that case you need to create unique report name(using time stamp).

      Extent merge will help you check the doc http://extentreports.relevantcodes.com/extentmerge/docs.html

      Reply
  46. snevs says

    December 6, 2015 at 10:47 PM

    Report looks so nice. I have a query, i want to change the report name and other default values. How do i do that?

    Reply
    • Mukesh Otwani says

      December 7, 2015 at 9:47 PM

      Hi Sneha,

      You can customized full report based on your need. Please check below documentation for Version 2

      http://extentreports.relevantcodes.com/java/version2/docs.html#assign-category

      Reply
  47. suresh says

    December 6, 2015 at 8:38 AM

    Hi Mukesh,
    How to generate extent reports in page object model or any framework (we can cal the methods in main class)

    Reply
    • Mukesh Otwani says

      December 7, 2015 at 9:49 PM

      Hi Suresh,

      Generating report in POM will remain same.Please try to implement and let me know if you are finding any issue.

      Reply
  48. sateesh says

    October 31, 2015 at 2:14 AM

    when i use 2.10 extent jar the report shows like only 2 tabs in the menu if i add category (smoke) then seeing 3 tabs under menu section………

    — is there any possibility to add an image of Project with small icon at top right or left
    — is there any way to hide the default host name and java version on Pie Chart below thing.
    — is Jenkins support this report or any reports are there which supports for jenkins.

    Reply
    • Mukesh Otwani says

      November 2, 2015 at 1:41 AM

      Hi Sateesh,

      Please find my comment below.

      1-is there any possibility to add an image of Project with small icon at top right or left?
      Ans-Yes you can customize this please check below link
      http://extentreports.relevantcodes.com/java/version2/docs.html

      2-is there any way to hide the default host name and java version on Pie Chart below thing?
      Ans- You can change host name and java version detected automatically.

      3-is Jenkins support this report or any reports are there which supports for jenkins?
      Ans- Yes jenkins support this report. 🙂

      Thanks
      Mukesh

      Reply
  49. Brijendra says

    October 20, 2015 at 6:05 PM

    while writing this ExtentReports extent = ExtentReports.get(AdvanceReporting.class);

    i am getting error for get method as its undefined.

    Kindly look at this.

    Reply
    • Mukesh Otwani says

      October 26, 2015 at 7:55 AM

      Hi,

      Here is the link for new version

      Reply
      • rajesh says

        November 7, 2016 at 8:18 PM

        Hi for me still it is showing old site not showing same as above new design site.

        Reply
        • Mukesh Otwani says

          November 7, 2016 at 8:39 PM

          Check new link of extent report http://extentreports.relevantcodes.com/

          Article link learn-automation.com/advance-selenium-reporting-with-screenshots-2/

          Reply

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Free Selenium Videos

https://www.youtube.com/watch?v=w_iPCT1ETO4

Search topic

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?

Stay connected via Facebook

Stay connected via Facebook

Archives

Footer

Categories

Recent Post

  • API Testing Using Postman And RestAssured
  • Disable Personalise Your Web Experience Microsoft Edge Prompt In Selenium
  • How To Fix Error: No tests found In Playwright
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Best and easy way to Group test cases in selenium

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?