Exporting Local Objects to an Object Repository

You can export all of the objects contained in a component's local object repository to a new shared object repository in the file system or to a Quality Center project (if QuickTest is connected to Quality Center). This enables you to make the local objects accessible to other components. You export local objects to a new shared object repository using the Object Repository window.

Note: If your local object repository contains objects with parameterized property values, when you export these objects to a shared object repository the parameterized values become repository parameters that are mapped to their previous values. For example, if a local object was parameterized to use a component parameter, when you export the local object to a shared object repository it will be modified to a repository parameter that is mapped to a component parameter with the same value.

Tip: After you export the local objects, you can use the Object Repository Merge Tool to merge the shared object repository containing the exported objects with another shared object repository.

To export local objects to a new shared object repository:

  1. Open the component that has the local objects you want to export.
  2. Make sure that the Object Repository window is open.
  3. Choose File > Export Local Objects. The Export 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 Export Object Repository dialog box.

  1. Select the location in which to save the file, specify the file or attachment name, and click Save or OK (depending on whether you are saving it to the file system or a Quality Center project).

The object repository is exported to the specified shared object repository (a file with a .tsr extension). You can now use the new shared object repository like any other shared object repository.

Modifying Test Object Properties at Runtime

You can modify the properties of the temporary version of the object during the run session without affecting the permanent values in the object repository by adding a SetTOProperty statement in a user-defined function.

Use the following syntax for the SetTOProperty method:

Object(description).SetTOProperty Property, Value

Working with Test Objects During a Run Session

The first time QuickTest encounters an object during a run session, it creates a temporary version of the test object for that run session. QuickTest uses the object description to create this temporary version of the object. For the remainder of the component, QuickTest refers to the temporary version of the test object rather than to the test object in the object repository.

Note: The Object Repository window is read-only during record and run sessions.

There are several ways to modify test object properties. Choose the way that best suits your needs:

  • You can manually change a test object property value to match a new static property of an object in your application. For
  • You can create a function (operation) that uses the SetTOProperty method to modify test object properties during a run session without changing the property values in the object repository.
  • You can modify the set of properties that QuickTest uses to identify the object, so that it will be able to identify an object even when some of its properties change.
  • You can use regular expressions to identify an object based on conditions or patterns you define.

Moving Objects in the Object Repository

You can copy, paste, and move objects in the local object repository using the Object Repository window, and copy, paste, and move objects both within a shared object repository and between shared object repositories using the Object Repository Manager. However, you cannot modify the root node of an object repository. You can also copy objects from a shared object repository to the local object repository to modify them locally.

You can move an object to a different location within an object repository by dragging it up or down the tree and dropping it at the required location. You can copy an object to a different location within an object repository by pressing the Ctrl key while dragging the object and dropping it at the required location in the tree.

When you drag an object, by default, any child objects are also moved or copied with it. If you want to move or copy an object without its child objects, you can drag it using the right mouse button. When you drop the object at the required location, you can choose whether to drop it with or without its children.

You can cut, copy, and paste objects within an object repository using the corresponding toolbar buttons or in the Edit menu. In the Object Repository Manager, you can also cut, copy, and paste objects between shared object repositories. When you cut, copy, and paste objects, the operation is performed also on the child objects of the selected object, if any.

In the Object Repository window, when you copy, paste, and move objects from a shared object repository associated with the component, the objects are copied, pasted, or moved to the local object repository of the component.

You cannot copy, paste, or move objects that have unmapped repository parameters from a shared object repository to the local object repository. If you copy, paste, or move an object from a shared object repository to the local object repository and the object or one of its parent objects are parameterized using one or more repository parameters, the repository parameter values are converted when you copy, paste, or move the object. For example, if the repository parameter is mapped to a local parameter, the property is parameterized using a local parameter. If the value is a constant value, the property receives the same constant value.

In the Object Repository Manager, you can copy an object from one shared object repository to another by opening both shared object repositories and dragging the object from one window and dropping it at the required location in the other window. You can move an object from one shared object repository to another by opening both shared object repositories pressing the Ctrl key while dragging the object from one window and dropping it at the required location in the other window. Note that moving an object removes it from one shared object repository and adds it to another.

Note: You can use the Edit > Undo and Edit > Redo options or Undo and Redo buttons to cancel or repeat your changes. When you save the object repository, you cannot undo and redo operations that were performed before the save operation.

When copying, pasting, or moving objects, consider the following:

  • If you change the object hierarchy, ensure that the new hierarchy is a valid recorded hierarchy.
  • If you paste or move an object to a different hierarchical level, you can choose whether to copy all objects up to the shared parent object (in the message displayed when you perform such an operation).
  • If you move an object to its immediate parent, QuickTest creates a copy of the object (renamed with an incremental suffix) and pastes it as a sibling of the original object.
  • If you cut or copy an object, and then paste it on its parent object, QuickTest creates copy of the object (renamed with an incremental suffix) and inserts it at the same level as the original object.
  • You cannot move an object to any of its descendants.
  • You cannot copy or move an object to be a child of a bottom-level object (an object that cannot contain a child object) in the object hierarchy.

Note: WinMenu objects can be either parent or bottom-level objects.