Class RetryTest

  • All Implemented Interfaces:
    org.testng.IRetryAnalyzer

    public class RetryTest
    extends Object
    implements org.testng.IRetryAnalyzer
    • Field Detail

      • PageErrors

        public static final String[] PageErrors
      • userIndex

        public static int userIndex
      • login_success_withError

        public static int login_success_withError
      • retryCount

        public int retryCount
      • enableRetry

        public static boolean enableRetry
    • Constructor Detail

      • RetryTest

        public RetryTest()
    • Method Detail

      • setExtendReport

        public void setExtendReport​(com.aventstack.extentreports.ExtentTest test,
                                    com.aventstack.extentreports.ExtentTest step)
      • setExtendReport

        public void setExtendReport()
      • getTest

        public com.aventstack.extentreports.ExtentTest getTest()
      • getStep

        public com.aventstack.extentreports.ExtentTest getStep()
      • retry

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

        public String getTestId​(org.testng.ITestResult iTestResult)
      • processTestResult

        public int processTestResult()
        if the max retry has not been reached, log the failure And quite the browser
        Returns:
      • logReportResult

        public void logReportResult​(int maxRetryCount)
        if failed rerun option is enabled, do not log failures until fails after suite
        Parameters:
        maxRetryCount -
      • logError

        public void logError​(String error)
      • pageHasError

        public boolean pageHasError​(Throwable t)
        returns true if any of the error types specified is caught
        Parameters:
        t -
        Returns:
      • errorHandling

        public int errorHandling​(Throwable t)
        error handling When test fails if any of the defined errors specified by PageErrors exists, Then the test will be retried
        Parameters:
        t -
        Returns:
      • randomFailStack

        public void randomFailStack​(ArrayList<String> FailTrace)