Showing posts with label Recovery Scenerios. Show all posts
Showing posts with label Recovery Scenerios. Show all posts

Enabling and Disabling Recovery Scenarios

You can enable or disable specific scenarios and determine when QuickTest activates the recovery scenario mechanism in the Recovery tab of the Application Area Settings dialog box. When you disable a specific scenario, it remains associated with the application area, but is not performed by QuickTest during the run session. You can enable the scenario at a later time.

You can also specify the conditions for which the recovery scenario is to be activated.

To enable/disable specific recovery scenarios:

  1. In the General pane of the application area, click the Additional Settings button. The Application Area Settings dialog box opens.
  2. Click the Recovery tab.
  3. In the Scenarios box, perform one of the following:
    • Select the check box to the left of one or more individual scenarios to enable them.
    • Clear the check box to the left of one or more individual scenarios to disable them.

To define when the recovery mechanism is activated:

  • Select one of the following options in the Activate recovery scenarios box:
    • On every step—The recovery mechanism is activated after every step.
    • On error—The recovery mechanism is activated only after steps that return an error return value.

Note that the step that returns an error is often not the same as the step that causes the exception event to occur.

For example, a step that selects a check box may cause a pop-up dialog box to open. Although the pop-up dialog box is defined as a trigger event, QuickTest moves to the next step because it successfully performed the check box selection step. The next several steps could potentially perform checkpoints, functions or other conditional or looping statements that do not require performing operations on your application. It may only be ten statements later that a step instructs QuickTest to perform an operation on the application that it cannot perform due to the pop-up dialog box. In this case, it is this tenth step that returns an error and triggers the recovery mechanism to close the dialog box. After the recovery operation is completed, the current step is this tenth step, and not the step that caused the trigger event.

    • Never—The recovery mechanism is disabled.

Note: Choosing On every step may result in slower performance during the run session.

How to remove Recovery Scenarios

In QuickTest, you can remove the association between a specific scenario and an application area using the Application Area Settings dialog box. After you remove a scenario from an application area, the scenario itself still exists, but QuickTest will no longer perform the scenario during a run session.

To remove a recovery scenario from your application area:

  1. In the General pane of the application area, click the Additional Settings button. The Application Area Settings dialog box opens.
  2. Click the Recovery tab.
  3. In the Scenarios box, select the scenario you want to remove.
  4. Click the Remove button. The selected scenario is no longer associated with the application area.

Setting Recovery Scenario Priorities

You can specify the order in which QuickTest performs associated scenarios during a run session. When a trigger event occurs, QuickTest checks for applicable recovery scenarios in the order in which they are displayed in the Recovery tab of the Application Area Settings dialog box.

To set recovery scenario priorities:

  1. In the General pane of the application area, click the Additional Settings button. The Application Area Settings dialog box opens.
  2. Click the Recovery tab.
  3. In the Scenarios box, select the scenario whose priority you want to change.
  4. Click the Up or Down button. The selected scenario's priority changes according to your selection.
  5. Repeat steps 3-4 for each scenario whose priority you want to change.

Viewing Recovery Scenario Properties

You can view properties for any recovery scenario in QuickTest associated with your application area.

Note: You modify recovery scenario settings from the Recovery Scenario Manager dialog box.

To view recovery scenario properties:

  1. In the General pane of the application area, click the Additional Settings button. The Application Area Settings dialog box opens.
  2. Click the Recovery tab.
  3. In the Scenarios box, select the recovery scenario whose properties you want to view.
  4. Click the Properties button. Alternatively, you can double-click a scenario in the Scenarios box. The Recovery Scenario Properties dialog box opens, displaying read-only information regarding the settings for the selected scenario

Copying Recovery Scenarios between Recovery Scenario Files

You can copy recovery scenarios from one recovery scenario file to another in QuickTest.

To copy a recovery scenario from one recovery scenario file to another:

  1. In the Scenarios box, select the recovery scenario that you want to copy.
  2. Click the Copy button. The scenario is copied to the Clipboard.
  3. Click the Open button and select the recovery scenario file to which you want to copy the scenario, or click the New button to create a new recovery scenario file in which to copy the scenario.
  4. Click the Paste button. The scenario is copied to the new recovery scenario file.

Notes:

If a scenario with the same name already exists in the recovery scenario file, you can choose whether you want to replace it with the new scenario you have just copied.

Modifications you make are not saved until you click Save in the Recovery Scenario Manager dialog box. If you have not yet saved your modifications, and you click the Close button in the Recovery Scenario Manager dialog box, QuickTest prompts you to save the recovery file. Click Yes to save your changes.

Saving the Recovery Scenario in a Recovery File

After you create or modify a recovery scenario in a recovery file using the Recovery Scenario Wizard, you need to save the recovery file.

To save a new or modified recovery file:

  1. Click the Save button. If you added or modified scenarios in an existing recovery file, the recovery file and its scenarios are saved. If you are using a new recovery file, the Save Attachment dialog box opens.

Tip: You can also click the arrow to the right of the Save button and select Save As to save the recovery file under a different name.

  1. Choose the folder in which you want to save the file.
  2. Type a name for the file in the File name box. The recovery file is saved in the specified location with the file extension .qrs.

Tip: If you have not yet saved the recovery file, and you click the Close button in the Recovery Scenario Manager dialog box, QuickTest prompts you to save the recovery file. Click Yes, and proceed with step 2 above. If you added or modified scenarios in an existing recovery file, and you click Yes to the message prompt, the recovery file and its scenarios are saved.

Understanding the Recovery Scenario Wizard

The Recovery Scenario Wizard leads you, step-by-step, through the process of creating a recovery scenario. The Recovery Scenario Wizard contains five main steps:

  • defining the trigger event that interrupts the run session
  • specifying the recovery operation(s) required to continue
  • choosing a post-recovery test run operation
  • specifying a name and description for the recovery scenario

You open the Recovery Scenario Wizard by clicking the New Scenario button in the Recovery Scenario Manager dialog box (Resources > Recovery Scenario Manager).

Deciding When to Use Recovery Scenarios

If you can predict that a certain event may happen at a specific point in your component, it is highly recommended to handle that event directly within your component by adding steps such as If statements in user-defined functions, rather than depending on a recovery scenario.

For example, if you know that an Overwrite File message box may open when a Save button is clicked during a run session, you can handle this event with an If statement in a user-defined function that clicks OK if the message box opens. Handling an event directly within your component enables you to handle errors more specifically than recovery scenarios, which by nature are designed to handle a more generic set of unpredictable events. It also enables you to control the timing of the corrective operation with minimal resource usage and maximum performance. By default, recovery operations are activated only occur after a step returns an error, which can potentially occur several steps after the one that actually caused the error. The alternative, checking for trigger events after every step, may slow performance.

You should use recovery scenarios only for unpredictable events, or events that you cannot synchronize with a specific step in your component. For example, a recovery scenario can handle a printer error by clicking the default button in the Printer Error message box. You cannot handle this error directly in your component, since you cannot know at what point the network will return the printer error. You could try to handle this event in your component by adding an If statement in a user-defined function immediately after the step that sent a file to the printer, but if the network takes time to return the printer error, your component may have progressed several steps before the error is displayed. Therefore, for this type of event, only a recovery scenario can handle it.