I want to stop the iteration whenever I receive an http error 500. Is there a way to stop the iteration (not the test -not Test.StopTest()- since I want the other iterations to continue, just to stop the one which gets the 500 error).
Re: How to stop the iteration (not the whole test)
I do all sorts of silly things to the recorded scripts, so I won't tell you what I do. However, a simple solution is to have a condition surrounding your "call SendRequest1()", etc statements, such that if you get the 500, it won't run any more, which will then run to the end of main(), ending the iteration.
Like have a script-scope variable like strHTTPResponse = oResponse.ResultCode in your SendRequestX() subs. In your main, you'd have "If (Left(strHTTPResponse,1) <> "5") Then call SendRequest1()" (if you want to catch all 500 type errors, not just 500 specifically.