While executing the QTP scripts, we might get some Unexpected errors. In order to recover the test and continue executing the rest of the script from these unexpected errors, Recovery Scenarios are used. The Recovery Scenario Manager can be accessed by Navigating to "Resources" -> Recovery Scenario Manager as shown below:
Steps to create Recovery Scenario:
Step 1 : Upon Clicking "New" Recovery Scenario button, the Recovery Scenario Wizard opens as shown below:
Step 2 : Next Step is to choose the Trigger Event. It corresponds to event which arises It can be any of the below four events.
- Pop-Up Window
- Object State
- Test Run Error
- Application Crash
Step 3 : Recovery Operations Window Opens. Recovery Operation can perform any of the following Operation as shown below:
Step 4 : Upon Specifying the appropriate Recovery Operation, we need to specify the Post Recovery Operation as well as shown below:
Step 5 : Upon Specifying the Post Recovery Operation, the recovery scenario should be named and added to the Test so that it will be activated.
Step 6 : The Recovery Scenario creation is complete and needs to be mapped to the current Test by checking the option "Add Scenario to the current Test" and click "Finish"
Step 7 : The Added Recovery Scenario will be as shown below and click on "Close" Button to continue.
Step 8 : Upon Clicking on Close Button, QTP would Pop up user to Save the created Recovery Scenarion. It will be saved with the extension .qrs and the wizard would be closed.
Verification:
The Created Recovery Scenario should be part of the test now and can be verified by navigating to "File" -> "Settings" -> "Recovery" Tab.