Method to exit a function as recovery scenario?
Hello, currently I am trying to set up a global recovery scenario for a web based testing script I am writing.
Currently the script works by calling a long series of functions with almost no actions done by the main script itself, all manipulation of the web site is within these functions, so all errors will occur within the functions as well.
I have been browsing around and trying to find out if there is a way to exit or go to the end of a function with some sort of command. Ideally, I would like to add a recovery scenario that will exit the current function on any error.
Is this even something that is possible in QTP? Thanks.
Re: Method to exit a function as recovery scenario?
Try Using these…
1. Exit Function
2. For Actions use….
• ExitAction. Exits the current action, regardless of its iteration attributes.
• ExitActionIteration. Exits the current iteration of the action.
• ExitRun. Exits the test, regardless of its iteration attributes.
• ExitGlobalIteration. Exits the current global iteration
Eg: CurrentCity = DataTable("City", dtLocalSheet)
If CurrentCity = "Paris" Then ExitActionIteration("Skipping Paris")
3. For loops use these…
Exit Do, Exit For, Exit Property, Exit Sub