Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I am using TestNG IRetryAnalyser, I am facing following issues

When I implement the listener and override retry () method getting following:

Listener com.socialtwist.taf.testnghelpers.RetryAnalyzer@1cc0a7f must be one of ITestListener, ISuiteListener, IReporter,  IAnnotationTransformer, IMethodInterceptor or IInvokedMethodListener
Usage: <main class> [options]

The following is listener code:

public class RetryAnalyzer implements IRetryAnalyzer {

private int count = 0; 

private int maxCount = 3; 
protected Logger log;
private static Logger testbaseLog;

static {

    testbaseLog = Logger.getLogger("testbase.testng");

public RetryAnalyzer()
    testbaseLog.trace( " ModeledRetryAnalyzer constructor " + this.getClass().getName() );


public boolean retry(ITestResult result) { 
    testbaseLog.trace("running retry logic for  '" 
            + result.getName() 
            + "' on class " + this.getClass().getName()+" with status "+result.getStatus()+"Retrying "+count+"times" );
        if(count < maxCount) {                     
                return true; 
        return false; 


The following is my test class:

public class Testing {

 public void testMethod1() {
      System.out.println("in method1 " );

I am using TestNG 6.3.1.jar.

share|improve this question
Your listener lass is named RetryAnalyzer, and yet in your test class, you refer to Analyzer.class. What is the Analyzer class? –  user246 Nov 6 '12 at 15:57
its type mistake, its RetryAnalyzer.clss –  saikrishna Nov 7 '12 at 6:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.