In this article, Tarun Lalwani summarizes the situations in which five qtp restoration scenarios will not be triggered:
Why is my recovery scenario not getting fired?
Http://knowledgeinbox.com/articles/qtp/recovery-scenario/why-is-my-recovery-scenario-not-getting-fired/
Debugging recovery scenario (RS) is always been a tough ask. But knowing situations where Rs won't work before hand can be of added
Advantage. In this article we will have e varous possible scenarios where RS is not fired. We will assume the RS to be fired is "any error"
Situation #1-The script errors script will not be triggered if the test object is not involved!
Errors not involving any test object won't fire any recovery scenario. All the code lines listed below will raise an error but not a Rs
X = 2/0
Y = left ("test",-2)
Situation #2-object not in Object repository (OR) object is not in or. This error will not trigger Rs execution!
If you try to access a object from the OR and it does not exist in the or at all, then qtp will throw an error and RS won't be fired. Object not
Found in Object repository error is treated as a script error by qtp and is raised directly.
The situation #3-Modal Dialog blocking mode dialog box blocks execution and does not trigger Rs execution!
In case the operation you have saved med causes a modal dialog to appear, RS can't get fired in such situations. The simplest example of this
The code shown below
Msgbox "you can't fire a recovery scenario now"
The call to the msgbox blocks execution in current thread and qtp get busy waiting for someone to close the message box. In such situations
No RS can get executed
Situation #4-associated library is not found cannot find the associated function library. This error will not trigger Rs execution!
In case the RS action is to call a function from a library file and library file is not found, the RS will not get triggered.
Situation #5-activate recovery Scenario setting is not configured properly if active recovery scenario is set to "never", RS will not be triggered
Go to file-> Settings... -> Recovery (Tab)-> activate recovery scenario option. If the value is set to 'never 'No RS can get fired, In case value is
Set to 'on error' then the recovery scenario will only be fired when an error occurs. In case the scenario is not fired change this setting to 'on
Every step'