filmov
tv
Re-Run failed test cases automatically | restAnalyzer attribute in TestNG | IRestAnalyzer | Selenium
![preview_player](https://i.ytimg.com/vi/czaUaKQy5HY/maxresdefault.jpg)
Показать описание
In this video we are going to see that how to rerun failed test cases in Selenium TestNG.
You can rerun the failed scenarios quickly by doing right click on this xml file and then select as tesng suite to run.
To retry failed test cases the moment they get fail. You can add below class in your framework.
public class RetryTest implements IRetryAnalyzer{
private int retrycount = 0;
private static final int maxcount = 2;
public boolean retry(ITestResult result) {
if(retrycount less than maxcount)
{
retrycount++;
return true;
}
return false;
}
after that you can below attribute to each test method.
@Test(restAnalyzer = RetryTest .classs)
public void testmethod()
{}
**********Please comment in case of any query*************
Also please watch other videos as well.
n
You can rerun the failed scenarios quickly by doing right click on this xml file and then select as tesng suite to run.
To retry failed test cases the moment they get fail. You can add below class in your framework.
public class RetryTest implements IRetryAnalyzer{
private int retrycount = 0;
private static final int maxcount = 2;
public boolean retry(ITestResult result) {
if(retrycount less than maxcount)
{
retrycount++;
return true;
}
return false;
}
after that you can below attribute to each test method.
@Test(restAnalyzer = RetryTest .classs)
public void testmethod()
{}
**********Please comment in case of any query*************
Also please watch other videos as well.
n