Retry on Fail

What command would I use to get a script to rerun after a failure?

Comments

  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    Look at the RunWithNewResults command. This allows one script to run another, check its status, and then take appropriate actions such as performing any necessary cleanup and running it again.

    Here's some sample code to illustrate how this might be done:
    RunWithNewResults theTest
    put the result into testResult
    
    if testResult.status is not "Success" then
        cleanupForSecondAttempt
        RunWithNewResults theTest -- second attempt
        put the result into testResult
    
        if testResult.status is not "Success" then
            Log theTest & " failed on the second attempt"
        end if
    end if
    
Sign In or Register to comment.