Better TestNG Reports with ATU Reporter

TestNG has decent reporting capability in terms of its in-built reports. But for some purpose, they may not be as user friendly as you’d like it to be. ATU Reporter is an open source utility which we can use to generate good looking TestNG reports. In this post, we will explore how we can configure ATU Reporter with Selenium WebDriver.

Before we proceed, let’s clarify that ATU Reporter will be useful to you only if you are using TestNG. It does not depend on Selenium. That means it can be used during unit testing as well.

A bit about ATU Reporter:

It’s an open source utility for TestNG framework. Its TestNG Listeners(ATUReportsListener, ConfigurationListener and MethodListener) can be used to generate customized graphical reports such as Line Chart, Bar Chart and Pie Chart. It is built using JQuery, CSS, HTML and jqPlot charting library.

Now, let’s take a look at how we can configure it with Selenium WebDriver project. Follow below steps for it.

  • Download latest version of ATU Reporter.
  • Unzip the file which contains JAR files of ATU Reporter and ATU Test Recorder, Java-doc, Properties file and a Sample Project.
  • Reference JAR files in your Selenium project.
  • Open class file. We need to add ATUReportsListener.class, ConfigurationListener.class and MethodListener.class Listeners to it. Make sure you update your class file with necessary package imports.
  • Reference ATU Reporter properties file in your class file with below code.
  • Set the driver object to the ATU Reporter. You can modify indexPageDescription value with your choice of description.
  • The ATUReports class has four overloaded add methods for logging the step information. Add these four methods using below code.
  • After performing all above steps, your class file should be as below.
  • Now, open your TestNG XML file and add necessary Listeners.
  • That’s it. Now run your project using TestNG. You should be able to see customized graphical TestNG reports at location defined in ATU Reporter’s properties file.

Below is the output of above exercise. It shows TestNG reports in Bar Chart format.

TestNG Reports

Bar Chart TestNG Report

As you can see, ATU Reporter is very useful in generating good looking TestNG reports. Give it a try and let us know if its useful in your case.

  1. basha
    • Maharshi
      • basha
      • basha
      • Anonymous
      • Saji
      • hasmukh
  2. seleniumuser
    • priyanka
  3. Anand
  4. janardhan reddy
  5. kakban
  6. Sumit
  7. Sateesh
  8. Tanmay
  9. Aswini Kumar Sahu
    • priyanka
  10. shiva kumar
  11. Ravindra
  12. swapnil
  13. Gobinath
  14. Pradeepq
  15. VidyaShankar
  16. Ravi
  17. purushothama
  18. Ruth Stephenson

Leave a Reply

Your email address will not be published.