I'm fairly new to QTP so forgive me if I've missed the obvious solution to my problem.
I have a script which runs through applications for a product online. The script is data-driven - options during the application are determined by values in a global datasheet. The script iterates through each row in the datasheet for each application.
The problem I have is that our environment is quite unstable. If my datasheet has 20 rows for 20 applications the environment is guaranteed to fall over at some point during a test run. When an environment error is returned, my script fails, but doesn't move on to the next iteration of the action.
My question is, how do I code the script to record the fail and immediately move on to the next iteration of the action?
I think I need something like a global ExitActionIteration instruction when a fail occurs or something similar, but I haven't been able to figure out how to do this.
I've already tried that and the script continues to step through every line of code in the current iteration after the error. What I'm looking for is a way to exit the current iteration as soon as an error is encountered.
Is there any way to do this globally for an action though? E.g. Have code at the start of the script to handle any error and move on to the next iteration (as opposed to the next line of code as On Error Resume Next does)?
Otherwise, I will have to code error handling into every page my script encounters.
This may be what I have to do after all, I'd just like to know if there is a more efficient way of doing it.