How to call the listener from maven POM for ExtentReport

1,949 views
Skip to first unread message

Venkateshwar Jeyasivanantha

unread,
Aug 26, 2015, 11:00:44 PM8/26/15
to testng-users
How to call the listener from maven POM for ExtentReport.

Instead of calling below tag from TestNG xml

<listeners>
<listener class-name="OpportunityModuleTests.ExtentReporterNG" />
</listeners>

Need to call from maven POM

<properties>
<property>
<name>usedefaultlisteners</name>
<value>True</value>
</property>
<property>
<name>listener</name>
<value>OpportunityModuleTests.ExtentReporterNG</value>
</property>
</properties>

Then above mentioned is not working, so report is not generated.

Krishnan Mahadevan

unread,
Aug 26, 2015, 11:08:33 PM8/26/15
to testng...@googlegroups.com

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

Venkateshwar Jeyasivanantha

unread,
Aug 27, 2015, 5:59:00 AM8/27/15
to testng-users
Hi Krishnan,

The site which you have referred I have tried it. Still the report is not being generated. But listener is placed in testNG.xml with <listener> tag, it works fine.

Thanks,
Venkateshwar

Krishnan Mahadevan

unread,
Aug 27, 2015, 7:12:08 AM8/27/15
to testng...@googlegroups.com
Venkatesh,

Can you please help create a sample project which can be executed to recreate the problem ?

You can perhaps just check it into github.com and share the repository link and me or someone else in this forum can take a look at it and see what is wrong.



Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Venkateshwar Jeyasivanantha

unread,
Aug 27, 2015, 11:50:46 AM8/27/15
to testng-users
Hi Krishnan,

I was actually looking into the wrong folder. Report is getting generated successfully. 

Thanks for your help!

Thanks,
Venkateshwar

sunny sachdeva

unread,
Aug 28, 2015, 12:26:48 AM8/28/15
to testng-users
HI Guys ,

I am also facing similar kind of issue. I followed the SO link posted by Krishnan. My Custom Reporter Listener is working but now issue is testng output folder and hence testng reports are not generated.

I need testNG results as well apart from custom reports because I am using Jenkins which have TestNG plugin which reads testng report to mark status of test cases.

Here is snippet from surefire plugin

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<forkMode>never</forkMode>
<properties>
<property>
<name>listener</name>
<value>com.sephoraflash.listeners.CustomReporter,com.sephoraflash.listeners.RetryTestListener</value>
</property>
</properties>
<systemPropertyVariables>
<testprops>${envproperties}</testprops>
</systemPropertyVariables>
<useFile>true</useFile>
<testFailureIgnore>true</testFailureIgnore>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/profiles/${suiteToRun}</suiteXmlFile>
</suiteXmlFiles>
<include>src/main/java</include>
<include>src/test/java</include>
</configuration>
</plugin>

Krishnan Mahadevan

unread,
Aug 28, 2015, 2:05:32 AM8/28/15
to testng...@googlegroups.com
Sunny

I didn't quite understand your problem. Can you please elaborate what is the issue that you are facing ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--

Venkateshwar Jeyasivanantha

unread,
Aug 28, 2015, 4:12:19 AM8/28/15
to testng-users
Sunny,

Please check for the reports in /Targert/surefire-reports folder, instead of searching for TestNG reports in "test-output" folder.

Thanks,
Venkateshwar
Reply all
Reply to author
Forward
0 new messages