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.