Selenium html reporting – Extent with testNG Listeners – Part 2

In this post, we will see how we can integrate extent report with testng listeners, in our previous post we have seen how to setup and integrate extent report with testNG classes.

TestngListeners helps us to execute set of code blocks in each event like before and after executing the test cases which reduces lines of code and dynamically generates logs based on what event it’s executing currently.



Watch demo for detail steps –

 

Folder structure –

extentReport
— — ExtentManager.java
— — ExtentTestManager.java
— — TestListeners.java
— — DriverContext.java
— — TestSampleExtentListeners.java

 

Code samples –

ExtentManager.java

Already described in our previous post

 

ExtentTestManager.java

 

TestListeners.java

 

TestSampleExtentListeners.java

 

Run below testNG.xml file to generate the html report

 

Hope this helps!

Share with friends…

Content posted is based on learning or working experience,
Share the post with others if find useful,
Any queries?, leave comments or discuss on our facebook:qavalidation.com, Thanks!

Leave a Reply

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