However, please keep in mind that this doesn't mean that RS will be triggered everytime. It is wise to know the behaviour of this function to utilize it better:
- RS will not be fired if it is a script error.
Errors here stands for errors which are not involving any Test Object, these are mostly known as syntax error. All the code lines below will raise an error but will not trigger a RS.
X = 2/0 Y = Left("Test", -2)
- RS will not be fired if the Object is not in Object Repository (OR).
If you try to access an 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 is treated as a script error by QTP.
- RS will not be fired if it encounter Modal dialog blocking execution.
In situation where your script causes a modal dialog to appear, RS can't get fired in such situations. Below is a sample of modal dialog code line:
Msgbox "You can't fire a Recovery scenario now"
This message box blocks the execution in current thread and QTP get busy waiting for someone to close the message box. In such situation, no RS will be executed.
- RS will not be fired if the required associated library is not found.
One of the operation type in Recovery Operation for RS is Function Call, if the function or the library file is not found for this Function Call, the RS will not get triggered.
- RS will not be fired if the Activate Recovery Scenario setting is not configured properly.
Ensure the configuration is setup properly. 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 the setting to 'On Every Step' to try.
- RS will not be fired if it is associated at run-time.
AOM is powerful as it helps us to setup our QTP test programmatically which save a lot of effort when there is a batch of scripts to be updated. However, if RS is associated only during run-time, it won't be fired.
Reference URL: http://knowledgeinbox.com/articles/qtp/recovery-scenario/why-is-my-recovery-scenario-not-getting-fired/
No comments:
Post a Comment