QTP - Recovery Scenarios
While executing the QTP scripts, we might get some unexpected errors. In order to recover the tests 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 − Click "New" Recovery Scenario button; the Recovery Scenario Wizard opens as shown below −
Step 2 − Choose the Trigger Event. It corresponds to event, which can arise in any of the following four events −
- Pop-Up Window
- Object State
- Test Run Error
- Application Crash
Step 3 − The Recovery Operations Window opens. Recovery Operation can perform any of the following Operation as shown in the screenshot below −
Step 4 − After specifying the appropriate Recovery Operation, we need to specify the Post Recovery Operation as well, as shown below −
Step 5 − After specifying the Post Recovery Operation, the recovery scenario should be named and added to the Test so that it can 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 the "Close" Button to continue.
Step 8 − After clicking the Close button, QTP would prompt the user to save the created Recovery scenario. It will be saved with the extension .qrs and the wizard would close.
The Created Recovery Scenario should be a part of the test now and can be verified by navigating to "File" → "Settings" → "Recovery" Tab.