Forum Discussion

testhrishi's avatar
testhrishi
Frequent Contributor
6 years ago

Events - Event handler to retry requets in a readyAPI Project

Is it possible to retry any request that fails with specific response status code using event handler for the project?
 

3 Replies

  • Lucian's avatar
    Lucian
    Community Hero

    I wrote something related to this here. Can you check it out and let us know if it works for you?

    • testhrishi's avatar
      testhrishi
      Frequent Contributor

      Thanks Lucian, however I wonder if there some grrovy script I can use at event level which will apply to all the tests in project when event triggers using response status code.

      • testhrishi's avatar
        testhrishi
        Frequent Contributor

        for ( testCaseResult in runner.results )
        {
        testCaseName = testCaseResult.getTestCase().name
        if ( testCaseResult.getStatus().toString() == "FAIL" )
        {
        testCaseResult.testCase.run(null, false)
        }
        }

         

        Looks like this try to run entire case. Is it possible to run just the failed step/request using similar script?