Class TestRetryAnalyzer

  • All Implemented Interfaces:
    org.testng.IAnnotationTransformer, org.testng.IRetryAnalyzer, org.testng.ITestNGListener
    Direct Known Subclasses:
    IgnoreSeleniumInternalErrors

    public class TestRetryAnalyzer
    extends Object
    implements org.testng.IRetryAnalyzer, org.testng.IAnnotationTransformer
    Implements TestNG test retry mechanism. You have to ensure proper reset mechanism otherwise the test will be reattempted while the application is in same state as previous attempt left it.

    Had an issue with JGiven: https://github.com/TNG/JGiven/issues/312

    Can be added as a listener, in this case the retry mechanism will get applied to all test methods covered by.

    • Field Detail

      • DEFAULT_INTERVAL_MS

        public static final int DEFAULT_INTERVAL_MS
        The default retry interval in milliseconds.
        See Also:
        Constant Field Values
      • DEFAULT_RETRIES

        public static final int DEFAULT_RETRIES
        The default retries.
        See Also:
        Constant Field Values
      • retryCounters

        public static final Map<String,​Integer> retryCounters
        Retries per qualified method name <class>.<method>.
    • Constructor Detail

      • TestRetryAnalyzer

        public TestRetryAnalyzer()
    • Method Detail

      • retry

        public boolean retry​(org.testng.ITestResult result)
        Specified by:
        retry in interface org.testng.IRetryAnalyzer
      • transform

        public void transform​(org.testng.annotations.ITestAnnotation annotation,
                              Class testClass,
                              Constructor testConstructor,
                              Method testMethod)
        Specified by:
        transform in interface org.testng.IAnnotationTransformer