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).

Synchronizing Object Repository Views

The Object Repository Merge Tool enables you to navigate the target, primary, and secondary object repositories independently. You can also resize the various panes to display only some of the objects contained in the repositories. When using large object repositories, this can result in the various panes displaying different areas of the repository hierarchies, making it difficult to locate and track specific objects affected by the merge process.

To synchronize the repositories to display the same object in both views, select the object in the primary or secondary object repository in which it is currently visible and click Synchronize Views

Resolving Object Conflicts

Conflicts between objects in the primary and secondary object repositories are resolved automatically by the Object Repository Merge Tool according to the default resolution settings that you can configure before performing the merge.

However, the Object Repository Merge Tool also allows you to change the way the merge was performed for each individual object that causes a conflict.

For example, an object in the primary repository could have the same name as an object in the secondary repository, but have a different description. You may have defined in the default settings that in this case, the object with the more generic object description, meaning the object with fewer properties, should be added to the target object repository. However, when you review the conflicts after the automatic merge, you could decide to handle the specific conflict differently, for example, by keeping both objects.

Note: Changes that you make to the default conflict resolution can themselves affect the target object repository by causing new conflicts. In the above example, keeping both objects would cause a name conflict. Therefore, the target object repository is updated after each conflict resolution change and redisplayed.

You can identify objects that caused conflicts, and the conflict type, by the icon displayed to the left of the object name in the target object repository pane of the Object Repository Merge Tool and the text color. When you select a conflicting object, a full description of the conflict, including how it was automatically resolved by the Object Repository Merge Tool, is displayed in the Resolutions Options pane.

The Resolutions Options pane offers alternative resolution options. You can choose to keep the default resolution if it suits your needs, or use the alternative options to resolve the conflict in a different way.

Tip: You can also change the default resolution settings and merge the files again.

To resolve object conflicts:

  1. In the target object repository, select an object that has a conflict, as indicated by the icon to the left of the object name. The conflicting objects are highlighted in the source repositories.

A description of the conflict and the resolution method used by the Object Repository Merge Tool is described in the Resolution Options pane. A radio button for each possible alternative resolution method is displayed.

  1. In the Resolution Options pane, select a radio button to choose an alternative resolution method. The target object repository is updated according to your selection and redisplayed.
  2. In the Resolution Options pane, click the Previous Conflict or Next Conflict buttons to jump directly to the next or previous conflict in the target object repository hierarchy.
  3. Repeat steps 1 through 3 to modify additional conflict resolutions, as necessary.
  4. Save the target object repository

Updating a Shared Object Repository from Local Object Repositories

You can update a shared object repository by merging local object repositories associated with one or more components (via the application area) into the shared object repository. The objects that are merged from the local object repositories are then available to any components that use that shared object repository.

In the merge process, the objects in the local object repository for the selected component are moved to the target shared object repository. The component then uses the objects from the updated shared object repository.

If you choose to add local object repositories for more than one component, QuickTest performs multiple merges, merging each component's local object repository with the target object repository one at a time, for all the components in the list. You can view and modify the results of each merge if necessary.

Note: You can only merge local object repositories from components whose application areas are associated with the shared object repository you are updating.

Merging Shared Object Repositories

QuickTest Professional provides the ability to merge existing assets from two repositories into a single shared object repository using the Object Repository Merge Tool. This tool enables you to merge two shared object repositories (called the primary object repository and the secondary object repository), into a new third object repository, called the target object repository. Objects in the primary and secondary object repositories are automatically compared and then added to the target object repository according to preconfigurable rules that define how conflicts between objects are resolved.

After the merge process, the Object Repository Merge Tool provides a graphic presentation of the original objects in the primary and secondary repositories, which remain unchanged, as well as the objects in the merged target object repository. Objects that had conflicts are highlighted. The conflict of each object that you select in the target object repository is described in detail. The Object Repository Merge Tool provides specific options that enable you to keep the suggested resolution for each conflict, or modify each conflict resolution individually, according to your requirements.

The Object Repository Merge Tool also enables you to merge objects from the local object repository of one or more actions into a shared object repository. For example, you may have learned objects locally in a specific action in your test and want to add them to the shared object repository, so that they are available to all actions in different tests that use that object repository.

Note: When the Object Repository Merge Tool is open, you cannot work with the Object Repository Manager

Saving Object Repositories

After you finish creating or modifying an object repository, you should save it. When you modify an object repository, an asterisk (*) is displayed in the title bar until the object repository is saved.

You can save an object repository to the file system or to a Quality Center project (if you are connected to a Quality Center project). If you want to associate the shared object repository with an application area so that it can be accessed by components, you must save it to your Quality Center project. You connect to a Quality Center project either from QuickTest or from the Object Repository Manager by choosing File > Quality Center Connection or clicking the Quality Center Connection button

Note: All changes you make to an object repository are automatically updated in all components open on the same computer that use the object repository as soon as you make the change—even if you have not yet saved the object repository with your changes. If you close the object repository without saving your changes, the changes are rolled back in any open components that were open at the time. When you open a component on the same computer on which you modified the object repository, the component is automatically updated with all saved changes made in the associated object repository. To see saved changes in a component or repository open on a different computer, you must open the component or object repository file or lock it for editing on your computer to load the changes.

To save an object repository:

  1. Make sure that the object repository you want to save is the active window.
  2. Choose File > Save or click the Save button. If the file has already been saved, the changes you made are saved. If the file has not yet been saved, the Save Shared Object Repository dialog box opens.

Note: If you are connected to Quality Center, the dialog box that opens is different from the standard file system dialog box. You can switch between the two dialog box versions by clicking the File System and Quality Center buttons in the Open Shared Object Repository dialog box.

  1. Select the folder in which you want to save the object repository.
  2. Enter a name for the object repository in the File name or Attachment Name box (depending on whether you are saving it to the file system or a Quality Center project). Use a descriptive name that will help you easily identify the file.

Note: You cannot use any of the following characters in the object repository name: \ / : * " ? < > |

  1. Click Save or OK (depending on whether you are saving it to the file system or a Quality Center project). QuickTest saves the object repository with a .tsr extension in the specified location and displays the object repository name and path in the title bar of the repository window.

Managing Object Repositories

The Object Repository Manager enables you to create and maintain shared object repositories. You can work with object repositories saved both in the file system and in a Quality Center project.

Each object repository contains the information that enables QuickTest to identify the objects in your application. QuickTest enables you to maintain the reusability of your components by storing all the information regarding your test objects in a shared object repository. When objects in your application change, the Object Repository Manager provides a single, central location in which you can update test object information for multiple components.

Note: Instead of, or in addition to, shared object repositories, you can choose to store all or some of the objects in a local object repository for each component.

If an object with the same name and description is located in both the local object repository and in a shared object repository that is associated with the same component, the component uses the local object definition. If an object with the same name and description is located in more than one shared object repository, and these shared object repositories are all associated with the same component, QuickTest uses the object definition from the first occurrence of the object, according to the order in which the shared object repositories are associated with the component. .

You can use the same shared object repository with multiple components. You can also use multiple object repositories with each component. In addition, you can save objects directly with an component in a local object repository. This enables them to be accessed only from that component.

If one or more of the property values of an object in your application differ from the property values QuickTest uses to identify the object, your component may fail. Therefore, when the property values of objects in your application change, you should modify the corresponding test object property values in the corresponding object repository so that you can continue to use your existing components.

You can modify objects in a shared object repository using the Object Repository Manager, as described in this section. You can modify objects stored in a local object repository using the Object Repository window

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.