My task is to catch any error, then log and exit.
Here are my questions:
1. QTP Recovery Scenario only can catch Test Object related errors, how do you catch runtime VBScript errors other than if Err.Number > 0 then?
2. I notice that QTP Test Runner can catch any run error, but how to make a listener with this?
3. Since my current framework does not use ActionIteration, how to exit all function call stack chain when I catch the run error?
Under [File => Settings] => [Run], select [Stop run] in the drop down box. when error occurs
You can use On Error Resume Next. Action should start with On Error Resume Next. Use if (err.Number>0) condition to exit
Thanks for your response.
On Error Resume Next only make sense with If Err.Number > 0 then...
Since the Run Error can occur anywhere, I cannot put If Err.Number > 0 on each step
Also, "Test.Run.Settings.OnError = Stop" stops the test instead of actionIteration. "NextIteration" does not work, too since we set Action Run only single one with our For Loop.