Re: [testng-users] Generate TestNG report during execution of the test

1,062 views
Skip to first unread message

Cédric Beust ♔

unread,
Jan 10, 2013, 10:10:19 AM1/10/13
to testng...@googlegroups.com
Reporters are run after the test run, by definition. If you need live information, use a listener. More details here:



-- 
Cédric



On Thu, Jan 10, 2013 at 6:37 AM, Raj Kumar <rajku...@gmail.com> wrote:
Generate TestNG report during execution of the test

TestNG reports are generated after completion of all the test. Is there any way I can generate the TestNG report during execution?

Thanks

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/cyDnsh1idNIJ.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Raj Kumar

unread,
Jan 23, 2013, 11:54:10 AM1/23/13
to testng...@googlegroups.com, ced...@beust.com
Hi, 

I am trying to call IReporter generateReport method in @AfterMethod for each method to generate report, How to get XmlSuite(java.util.List<org.testng.xml.XmlSuite>) and iSuites (java.util.List<org.testng.ISuite>) real time values during execution?

Thanks

Anand Garlapati

unread,
Jan 23, 2013, 12:30:06 PM1/23/13
to testng...@googlegroups.com

Krishnan Mahadevan

unread,
Jan 24, 2013, 4:44:49 AM1/24/13
to testng...@googlegroups.com, ced...@beust.com
IReporter interface listener is supposed to be invoked by TestNG and NOT by you. 
Visit this group at http://groups.google.com/group/testng-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
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/

Raj Kumar

unread,
Jan 24, 2013, 5:28:02 AM1/24/13
to testng...@googlegroups.com, ced...@beust.com
IReported is called at the end of execution, but I want to check the report during execution to see the failures.


On Thursday, 24 January 2013 09:44:49 UTC, Krishnan wrote:
IReporter interface listener is supposed to be invoked by TestNG and NOT by you. 

On Wednesday, January 23, 2013, Raj Kumar wrote:
Hi, 

I am trying to call IReporter generateReport method in @AfterMethod for each method to generate report, How to get XmlSuite(java.util.List<org.testng.xml.XmlSuite>) and iSuites (java.util.List<org.testng.ISuite>) real time values during execution?

Thanks

On Thursday, 10 January 2013 15:10:19 UTC, Cédric Beust ♔ wrote:
Reporters are run after the test run, by definition. If you need live information, use a listener. More details here:



-- 
Cédric



On Thu, Jan 10, 2013 at 6:37 AM, Raj Kumar <rajku...@gmail.com> wrote:
Generate TestNG report during execution of the test

TestNG reports are generated after completion of all the test. Is there any way I can generate the TestNG report during execution?

Thanks

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/cyDnsh1idNIJ.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users+unsubscribe@googlegroups.com.

Yevhen Bilevych

unread,
Jan 24, 2013, 5:32:51 AM1/24/13
to testng...@googlegroups.com
Raj,

Perhaps it makes sense to take a look at the listeners, as Cédric mentioned below?

Thanks,
Yevhen
To unsubscribe from this group, send email to testng-users...@googlegroups.com.

meny peled

unread,
Oct 9, 2014, 2:25:44 AM10/9/14
to testng...@googlegroups.com
Hi Raj,
i am facing the same dilemma & i want to "force" report generation in my @AfterSuite annotation (the main reason is that i wans to send the latest emailable.html to my team).
i was wondering how did you overcome it & created the report during run time?

thanks in advance!!! 

Krishnan Mahadevan

unread,
Oct 9, 2014, 3:56:24 AM10/9/14
to testng...@googlegroups.com
Here's something that you can try following.

1. Create a TestNG listener that basically implements the IInvokedListener. Within the afterInvocation() method, start collecting test results (by inspecting the ITestResult object). You can choose to start keeping this in memory (you may need to ensure that the data structure you would be using like a map or list or a set should be resilient to multi threading ) or you can consider dumping this information into a file system (as JSON/XML/CSV/YAML) or a database.
2. Create a second listener which implements ISuiteListener and within the onFinish() method, query the consolidated data (from step 1), create your report and then send it across.



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.
Reply all
Reply to author
Forward
0 new messages