how can I run testng-failed.xml via Jenkins or any other means automatically if some of my test case failed

1,377 views
Skip to first unread message

SeleniumQA

unread,
Aug 15, 2014, 2:22:16 PM8/15/14
to testng...@googlegroups.com
Hi Guys, 

Please help me in re-running the testNg-failed.xml automatically via Jenkins or any other mean if test cases are getting failed.

Krishnan Mahadevan

unread,
Aug 16, 2014, 1:22:24 AM8/16/14
to testng...@googlegroups.com
There are multiple ways in which you can re-run failed tests.

1. Use a retry analyzer and implement the retry running of tests using this.
2. In CI systems such as Jenkins, you have the option of adding a post build step wherein you can write up a simple shell script which basically checks if there is a testng-failed.xml file available in the test output path and if it is available then kick off the build [ by running either the ant task or the maven task ] by providing the suite file to be executed as testng-failed.xml


Note:
Approach 2 is going to be messing up your test results (if you are dependent on the default reports that TestNG provides) because it would get overwritten. So you may have to put in additional checks in those areas as well.

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/


On Fri, Aug 15, 2014 at 11:52 PM, SeleniumQA <partee...@gmail.com> wrote:
Hi Guys, 

Please help me in re-running the testNg-failed.xml automatically via Jenkins or any other mean if test cases are getting failed.

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

SeleniumQA

unread,
Aug 18, 2014, 1:18:06 PM8/18/14
to testng...@googlegroups.com
Thanks Krishna, Could you please provide any blog reference if you are aware of, thanks.
Reply all
Reply to author
Forward
0 new messages