Can we register 2 listeners at the same time in Testng.xml | Selenium Forum
M
Posted on 16/01/2016
Hi Ashish,

I was practising hte Data Driven Framework. I had registered the Custom Listener and ExtentReporterNG in the TestNg.xml When i run the test from eclipse, i observed that the Custom Listener was not called even if its registered but ExtentReporterNG was called and generating Extent.html reports. And when icommented the ExtentReporterNG , and run the textng.xml from eclipse, Customer listener was called and generating the Report.xlsx files etc.

It this expected?

M
Replied on 17/01/2016

can you repeat the question i couldn't get the problem?


M
Replied on 08/02/2016

Hi Ashish,

I was practicing the Data Driven Framework. I had registered the Custom Listener and ExtentReporterNG(For Extent Reports) in the TestNg.xml.

When I run the test from eclipse, I observed that the Custom Listener was not called (I did not get the messages from Custum Lister.Java file ) even if its registered (registered in pom.xml )but ExtentReporterNG was called and generating Extent.html reports. And when I commented the ExtentReporterNG(from pom.xml) , and run the textng.xml from eclipse, Customer listener was called and generating the Report.xlsx files and not the extent reports (because ExtentReporterNG was commented) etc.


So my doubt is can we register 2 listeners at the same time ( 2 listeners in this scenario are 1. CustomListener.java 2. ExtentReporterNG.java)?


Hope its clear now.


M
Replied on 08/02/2016

[quote:14zu2elz]So my doubt is can we register 2 listeners at the same time ( 2 listeners in this scenario are 1. CustomListener.java 2. ExtentReporterNG.java)?
[/quote:14zu2elz]

i have not tried it but i don't think there should be any trouble.