tag:blogger.com,1999:blog-2727354435270311889.post4125512109033079978..comments2023-08-04T19:34:07.798+05:30Comments on Easy Test Automation: SELENIUM : RERUN FAILED TEST SCRIPTS USING TESTNGUnknownnoreply@blogger.comBlogger4125tag:blogger.com,1999:blog-2727354435270311889.post-72064992900172574552016-07-15T13:57:59.852+05:302016-07-15T13:57:59.852+05:30Hello, I don't have any blog for Test run coun...Hello, I don't have any blog for Test run count after retry. I will write the same. But I would have handled this scenario by putting below codes in @Aftermethod :<br /><br /><br /><br />for (int i = 0; i < context.getAllTestMethods().length; i++) {<br /> if (context.getAllTestMethods()[i].getCurrentInvocationCount() == 2) {<br /> if (context.getFailedTests()<br /> .getResults(context.getAllTestMethods()[i]).size() == 2<br /> || context.getPassedTests()<br /> .getResults(context.getAllTestMethods()[i])<br /> .size() == 1) {<br /><br /> context.getFailedTests().removeResult(<br /> context.getAllTestMethods()[i]);<br /> }<br /> }<br /> }<br /><br /><br />where context is of type ITestContext and a parameter in teardown method with @AfterMethod annotation. Here I am removing failed one in all executions of particular test script. Just try it and let me know if it helped. R K Singhhttps://www.blogger.com/profile/02812516804366775898noreply@blogger.comtag:blogger.com,1999:blog-2727354435270311889.post-51479079972832499342016-07-07T23:18:29.378+05:302016-07-07T23:18:29.378+05:30Thank you.. It actually working now. I had some ot...Thank you.. It actually working now. I had some other code issues. Do you have nay blog regarding "TestNG Tests Run Count after Retry" ... I run through Jenkins via maven-surefire-plugin. <br /><br />Thanks,Automation_Engrhttps://www.blogger.com/profile/17821947561167455281noreply@blogger.comtag:blogger.com,1999:blog-2727354435270311889.post-76232965389752715982016-07-06T15:08:03.210+05:302016-07-06T15:08:03.210+05:30It should work. Although I will try with this spec...It should work. Although I will try with this specific version of TestNG- 6.8.7. Meanwhile provide more details, if you can, It may help in debugging your issue.R K Singhhttps://www.blogger.com/profile/02812516804366775898noreply@blogger.comtag:blogger.com,1999:blog-2727354435270311889.post-2560070827078887962016-06-30T22:38:18.634+05:302016-06-30T22:38:18.634+05:30Doesn't work in TestNG 6.8.7...The failed test...Doesn't work in TestNG 6.8.7...The failed test is skipping instead of re-running.Automation_Engrhttps://www.blogger.com/profile/17821947561167455281noreply@blogger.com