DEV Community


Discussion on: How to use Extent Reports with TestNG in Selenium Java

anandbhagwat profile image
Anand Bhagwat

Hi Manul, Thanks for sharing this. I am exploring this. wanted to ask, any reason you used test.pass? because even if test faill it will show test pass in testng, Any better aapproach for making pass fail like using testng ITestListener for onSuccess and onFail method?
any better way you suggest

mwickrmanayaka profile image
Manul wickrmanayaka Author

Hi Anand, Thank you for your feedback.
Yes it would be better to pass ExtentReports instance in TestNG ITestListener methods.
And you can also try Creating a class implementing "IReporter" listener which is defined in the testng.xml file.

Find the explanation below