cancel
Showing results for 
Search instead for 
Did you mean: 

Events - Event handler to retry requets in a readyAPI Project

testhrishi
Frequent Contributor

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 3
Lucian
Community Hero

Re: Events - Event handler to retry requets in a readyAPI Project

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



If my answer helped please click on the 'Accept as Solution' button.
testhrishi
Frequent Contributor

Re: Events - Event handler to retry requets in a readyAPI Project

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
Frequent Contributor

Re: Events - Event handler to retry requets in a readyAPI Project

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?

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors