TestNG results not displayed in chronological order of execution

461 views
Skip to first unread message

Niranjan Maturi

unread,
May 12, 2016, 9:07:32 AM5/12/16
to testng-users

I am using TestNG 6.9.9 and I want my emailable-report.html to have tests in the order they were executed. Looks like default behavior is the alphabetical order. Is there a way to order the tests with their end time (without having to generate the whole custom HTML report using IReporter)?

BTW, my testng-results.xml has the correct order (by execution time). Only the report has alphabetical order.

Thanks

Aparna


testng-results.xml
testng.xml

⇜Krishnan Mahadevan⇝

unread,
May 12, 2016, 11:39:10 PM5/12/16
to testng...@googlegroups.com
Niranjan,

On a bare minimum level, here's what you may have to do.

The method that is responsible within the EmailableReporter2 to print all the method information is this 

If you just alter it, it should solve your purpose.

So you can do one of the following :

Classpath overriding : [ This is more of a hack ]
Here you copy the entire EmailableReporter2 java class and house it in the same package in your test code. You then modify the method based on your needs and use it 

Extend EmailableReporter2 
Here you basically extend the above mentioned class and just provide an overridden implementation of org.testng.reporters.EmailableReporter2#writeScenarioDetails(), inject your custom implementation as a listener and disable the default EmailableReporter2 that TestNG generates [ this is to ensure that you don't end up causing two reporters to step on each others shoes because both of them would be writing to the same file ]



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 https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

Ann Millikin

unread,
Mar 29, 2019, 11:04:57 AM3/29/19
to testng-users
It seems a lot of folks want the reporter output to be in execution order (a.k.a. chronological order) not Alphabetical order by class within package including me.  :)

Is the implementation of overriding the EmailableReporter2.writeScenarioDetails documented some where?  Will this override sort the index.html reporter output in execution order or just what is emailed?

Thank you so much!

-Ann



On Thursday, May 12, 2016 at 11:39:10 PM UTC-4, Krishnan Mahadevan wrote:

Extend EmailableReporter2 
Here you basically extend the above mentioned class and just provide an overridden implementation of org.testng.reporters.EmailableReporter2#writeScenarioDetails(), inject your custom implementation as a listener and disable the default EmailableReporter2 that TestNG generates [ this is to ensure that you don't end up causing two reporters to step on each others shoes because both of them would be writing to the same file ]



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...@googlegroups.com.

Shiva Prasad Adirala

unread,
Mar 29, 2019, 11:14:04 AM3/29/19
to testng...@googlegroups.com
To resolve this issue you can try testng-metrics a custom html report where we can sort results based on name, status and exection time


Project Readme.md (usage) - 
https://github.com/adiralashiva8/testng-metrics/blob/master/README.md

To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages