Hi all,I have 2 tests. TestA and testBTestA -> fails firsttime and passes on retryTestB dependent on TestA using dependsOnMethods = "testA" attribute.TestA uses retry analyzer @Test(retryAnalyzer = RetryAnalyzer.class) so that it can be rerun on failure.Now the current behavior as below :-1. TestA fails for 1st attempt and get retried.2. TestA passes in 2nd attempt.3. TestB marked as skipped.I would expect TestB not to get skipped as latest result of testA is pass.I have attached source code here to repro the same. Please let me know how to make testB run on retry. I dont want it to get marked as skipped.I did post the same question in testNG-DEV. I havnt received any reply yet. May be they are bit busy as lot of people will request answers to their questions. I think this is a common problem and many might have faced it and found some solution already. So i am posting my question here aswell.ThanksShankar KC--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/bdSdkxFVXTYJ.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Shankar,What version of TestNG were you using?How are you running your tests?
Perhaps you might wanna include this info as well!
On Sunday, September 23, 2012, shankar KC wrote:
Hi all,I have 2 tests. TestA and testBTestA -> fails firsttime and passes on retryTestB dependent on TestA using dependsOnMethods = "testA" attribute.TestA uses retry analyzer @Test(retryAnalyzer = RetryAnalyzer.class) so that it can be rerun on failure.Now the current behavior as below :-1. TestA fails for 1st attempt and get retried.2. TestA passes in 2nd attempt.3. TestB marked as skipped.I would expect TestB not to get skipped as latest result of testA is pass.I have attached source code here to repro the same. Please let me know how to make testB run on retry. I dont want it to get marked as skipped.I did post the same question in testNG-DEV. I havnt received any reply yet. May be they are bit busy as lot of people will request answers to their questions. I think this is a common problem and many might have faced it and found some solution already. So i am posting my question here aswell.ThanksShankar KC--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/bdSdkxFVXTYJ.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Let me know the issue you are facing. I will help. I will try to send accross code i wrote. It works for me.... Once i reach office i will update.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
--
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/
--
You received this message because you are subscribed to a topic in the Google Groups "testng-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/testng-users/WMNZ5uzM6DE/unsubscribe.
To unsubscribe from this group and all its topics, 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.
To unsubscribe from this group, send email to testng-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
--
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/
Np glad it worked for you
Hi Shankar,
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
--
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/
--
You received this message because you are subscribed to a topic in the Google Groups "testng-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/testng-users/WMNZ5uzM6DE/unsubscribe.
To unsubscribe from this group and all its topics, 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.
Hi Shankar,
To unsubscribe from this group, send email to testng-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
--
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/
--
You received this message because you are subscribed to a topic in the Google Groups "testng-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/testng-users/WMNZ5uzM6DE/unsubscribe.
To unsubscribe from this group and all its topics, 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.
@Override
public boolean retry(final ITestResult result) {
if (isRetryAvailable()) {
if (counter <= retryLimit) {
result.setStatus(ITestResult.SKIP);
result.getTestContext().getFailedTests().removeResult(result);
result.getTestContext().getSkippedTests().removeResult(result);
counter++;
String message = Thread.currentThread().getName() + ": Error in " + result.getName()
+ " [result.getMethod(): " + result.getMethod() + " ] Retrying " + (retryLimit + 1 - counter)
+ " more times";
System.out.println(message);
return true;
}
System.out.println("Exhausted retries for test case " + result.getMethod());
}
return false;
}
@Override
public boolean retry(final ITestResult result) {
if (!result.isSuccess()) {
if (counter < retryLimit) {
result.getTestContext().getFailedTests().removeResult(result);
result.getTestContext().getSkippedTests().removeResult(result);
counter++;
return true;
} else {
result.setStatus(ITestResult.FAILURE);
}
} else {
result.setStatus(ITestResult.SUCCESS);
}
return false;
}
Shankar,What version of TestNG were you using?How are you running your tests?
Perhaps you might wanna include this info as well!
On Sunday, September 23, 2012, shankar KC wrote:
Hi all,I have 2 tests. TestA and testBTestA -> fails firsttime and passes on retryTestB dependent on TestA using dependsOnMethods = "testA" attribute.TestA uses retry analyzer @Test(retryAnalyzer = RetryAnalyzer.class) so that it can be rerun on failure.Now the current behavior as below :-1. TestA fails for 1st attempt and get retried.2. TestA passes in 2nd attempt.3. TestB marked as skipped.I would expect TestB not to get skipped as latest result of testA is pass.I have attached source code here to repro the same. Please let me know how to make testB run on retry. I dont want it to get marked as skipped.I did post the same question in testNG-DEV. I havnt received any reply yet. May be they are bit busy as lot of people will request answers to their questions. I think this is a common problem and many might have faced it and found some solution already. So i am posting my question here aswell.ThanksShankar KC--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/bdSdkxFVXTYJ.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.