Maintain test objects in object repositories

Relevant for: GUI tests and components

The following steps describe different options for maintaining and modifying the test object details of objects in your repositories.

Specify an value

  1. In the Object Repository window or the Object Repository Manager, select the test object whose property value you want to specify.

  2. In the Test object details area, click in the value cell for the required property.

  3. Specify the property value in one of the following ways:

    • If you want to specify a constant value, enter it in the value cell.

    • If you want to parameterize the value or specify a constant value using a regular expression, click the parameterization button in the value cell .

Back to top

Update description properties

  1. In the object repository tree, select the test object whose description you want to update.

  2. Select Object > Update from Application or click the Update from Application button . UFT is hidden, and the pointer changes into a pointing hand.

  3. Find the object in your application whose properties you want to update in the object repository and click it. You must choose an object of the same object class as the test object you selected in the object repository tree.

    The properties and property values for the selected object are updated in the object repository, according to the properties and values required to identify the object that were learned by UFT when you clicked the object in your application. Note that all properties and property values in the Test object details area are updated, together with the ordinal identifier and Smart Identification selections. Any object-specific comments that you may have entered are not removed.

Back to top

Restore the mandatory property set

  1. In the object repository tree, select the test object whose description you want to restore.

  2. In the Test object details area, click the Restore mandatory property set button .

  3. Click Yes to confirm the operation. The test object's description properties are restored to the mandatory property set for the selected object class at the time that the object was learned.

Back to top

Rename test objects

  1. In the object repository tree of the Object Repository window or Manager, select the test object that you want to rename.

  2. In the Name box in the Object Properties pane, enter the new name for the test object. Then click anywhere else to remove the focus from the object. Test object names are not case-sensitive.

Add properties to a test object description

  1. In the object repository tree of the Object Repository window or Manager, select the test object whose description you want to modify.

  2. In the Test object details area, click the Add description properties button .

  3. The Add Properties Dialog Box opens listing the properties that can be used to identify the object (properties that are not already part of the test object description).

    Tip: For a test object in the local object repository, you can also select the required test object and select Edit > Step Properties > Object Properties, click the Add description properties button , and then perform the following steps in the Add Properties dialog box.

Back to top

Define a new description property

  1. In the object repository tree of the Object Repository window or Manager, select the test object for which you want to define a new property.

  2. In the Test object details area, click the Add description properties button . The Add Properties Dialog Box opens.

    Tip: For a test object in the local object repository, you can also select the required test object, right-click on the object and select Object Properties, click the Add description properties button , and then perform the following steps in the Add Properties dialog box.

  3. Click the Define new property button . The New Property Dialog Box opens.

  4. In the New Property dialog box, provide details for your property and click OK.

Back to top

Remove properties from a test object description

  1. In the object repository tree of the Object Repository window or Manager, select the test object whose description you want to modify.

  2. In the Test object details area, select one or more properties that you want to remove from the test object description.

    Tip: For an object in the local object repository, you can also select the required test object, right-click and select Object Properties, and then perform the following steps in the Object Properties Dialog Box.

  3. Click the Remove selected description properties button . The selected properties are removed from the test object description.

Back to top

Specify an ordinal identifier

  1. In the object repository tree of the Object Repository window or Manager, select the test object whose ordinal identifier you want to specify.

  2. In the Test object details area, click in the cell to the right of the Type, Value cell under the Ordinal identifier row.

    Tip: For an object in the local object repository, you can also select the required test object, right-click and select Object Properties, click in the cell to the right of the Type, Value cell under the Ordinal identifier row, and then perform the following steps in the Object Properties Dialog Box.

  3. Click the Browse button. The Ordinal Identifier Dialog Box opens.

  4. In the Ordinal Identifier dialog box, provide the ordinal details and click OK.

Back to top

Define related objects for a specific test object

  1. In the Visual Relation Identifier Settings row of the Object Repository window or Object Properties dialog box, click in the Value cell.

  2. Click the Browse button in the cell. The Visual Relation Identifier Dialog Box opens.

  3. Set the options for the visual relation identifier.

Results:

  • The visual relation identifier is added to the selected test object, and the text in the Value cell indicates that a visual relation identifier is defined.

  • Any related objects you specified are linked to the test object for which you are using a visual relation identifier. You cannot define visual relations for those objects.

  • The Ordinal identifier property is disabled in the Object Details area of the local or shared object repository, and is not used during the object identification process. However, UFT still uses this property during the learn process, when comparing existing objects with the objects to be learned, and therefore the ordinal identifier value should not be manually changed or removed.

Back to top

Export the objects from a local object repository

In the local object repository window, select File > Export Local Objects, or, for actions only, File > Export and Replace Local Objects. The Save Shared Object Repository window opens.

If you chose Export Local Objects, the local objects are exported to the specified shared object repository (a file with a .tsr extension). Your test or component continues to use the objects in the local object repository, and the new shared object repository is not associated with your test.

If you chose Export and Replace Local Objects, the new shared object repository (a file with a .tsr extension) is associated with your test, and the objects in the local object repository are deleted. The objects in the Object Repository window are read-only, as they are now in a shared object repository. In the Object Properties section of the Object Repository window, the repository location indicates the path and filename of the new shared object repository instead of Local.

In addition, when you export local objects to a shared object repository, the parameters of any parameterized objects are converted to repository parameters, using the same name as the source parameter. The default (mapped) value of each repository parameter is the corresponding source parameter.

Back to top

Copy an object to the local object repository

This task describes how to copy an object from a shared object repository to the local object repository.

  1. Open the test or component that contain the local object repository to which you want to copy the object.

  2. Open the Object Repository window by selecting Resources > Object Repository or clicking the Object Repository button .

  3. In the object repository tree of the Object Repository window, select the action or component associated with the shared object repository containing the object you want to copy.

  4. Select the object that you want to copy to the local object repository. (Objects in a shared object repository are read-only.) You can select multiple objects as long as the selected objects have the same parent object.

  5. Select Object > Copy to Local or right-click the objects and select Copy to Local. The objects (and parent objects, if any) are copied to the local object repository and are made editable.

Back to top

Modify description properties during a run session

Add a SetTOProperty statement in a user-defined function, or in your action with the following syntax:

Object(description).SetTOPropertyProperty, Value

Back to top