How to run the failure tests automatically after completion of suite.

709 views
Skip to first unread message

venkat paloju

unread,
Jan 22, 2014, 7:57:43 AM1/22/14
to testng...@googlegroups.com
Hi All,

Please help on the following,

We have automated tests, due to the application instability on test environment tests are failing often.
We are planning to write the retry logic to run all the failed tests end of the suite execution, and report the final result merge of all the retries.

Thanks in advance...

Thanks,
Chary.

Yevhen Bilevych

unread,
Jan 22, 2014, 12:40:07 PM1/22/14
to testng...@googlegroups.com

Hey Chary,

There are at least two ways:

1. See http://testng.org/doc/documentation-main.html#rerunning
2. Implement IRetryAnalyzer (say, this article: http://sinisa229.info/?p=6)

Yevhen
> --
> 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/groups/opt_out.

venkat paloju

unread,
Jan 28, 2014, 3:53:36 AM1/28/14
to testng...@googlegroups.com
Hi Bilevych,

Thanks for reply, please share me if you are using the retry logic after suite completion.

Thanks,
Venkat.

吴亭

unread,
Jan 28, 2014, 4:10:06 AM1/28/14
to testng...@googlegroups.com
Hi,

For solution 1:
http://testng.org/doc/documentation-main.html#rerunning, the rerun
will startup a new JVM, so it hard to merge your data I think except
you think about some way to do this.

For solution 2: is good, but may not meet your requirement.

For our team, we try to do this type of thing, we define a new test
listener, called xxxReRunListener, which extends IExecutionListener,
ISuiteListener, after all of the suite executed, we will check if we
need to rerun failed test case at onExecutionFinish method.

We will try to generate the failed.xml by ourself because during that
time, this file still not generated.

Later, we will call TestNG.main (file as parameters) to run it.

For this way, it will use one JVM, but it also require your code dont
have so many static staff, otherwise, you have reset lost of staff.


2014-01-28 venkat paloju <venkat...@gmail.com>:

venkat paloju

unread,
Jan 28, 2014, 5:15:55 AM1/28/14
to testng...@googlegroups.com
Hi Ericsson,

Thanks alot for reply..
I have small doubt on your post, how we extend  IExecutionListener,  ISuiteListener.
I request you to please help me to generate failed.xml and onExecutionFinish method implementation.

Thanks,
Chary..

On Wednesday, 22 January 2014 18:27:43 UTC+5:30, venkat paloju wrote:

吴亭

unread,
Jan 28, 2014, 6:13:59 AM1/28/14
to testng...@googlegroups.com
Hi,

Both IExecution and suite listener are the interfaces, it is okej for
you to implement several interface.

For generated failed.xml, try to read the code how TesstNG generate
the failed.xml, we just copied the solution from testng.

Br,
Tim

2014-01-28 venkat paloju <venkat...@gmail.com>:

venkat paloju

unread,
Feb 4, 2014, 5:39:48 AM2/4/14
to testng...@googlegroups.com
Hi Ericsson,

Please provide the implementation logic of RetryAnalyzer if you have completed.
Please provide the steps to implement to frame new xml file and summarize all the reports at the end.
Please help me on these..

Thanks,
Venkat.


On Wednesday, 22 January 2014 18:27:43 UTC+5:30, venkat paloju wrote:
Reply all
Reply to author
Forward
0 new messages