Maintain test objects in object repositories
Relevant for: GUI tests and components
The following steps describe different options for maintaining and modifying the details of test objects in your repositories.
Specify a value
-
In the Object Repository window or the Object Repository Manager, select the test object whose property value you want to specify.
-
In the Test object details area, click in the value cell for the required property.
To quickly jump to a property in the list, click in the Name column and start typing the property name.
-
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 .
-
Note: When retrieving property values from the object repository, UFT One trims leading and trailing spaces.
Update description properties
-
In the object repository tree, select the test object whose description you want to update.
-
Select Object > Update from Application or click the Update from Application button . UFT One is hidden, and the pointer changes into a pointing hand.
-
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 One 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.
Restore the mandatory property set
-
In the object repository tree, select the test object whose description you want to restore.
-
In the Test object details area, click the Restore mandatory property set button .
-
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.
Rename test objects
-
In the object repository tree of the Object Repository window or Manager, select the test object that you want to rename.
-
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.
Caution: When you rename a test object, UFT One renames the test object in the open test accordingly. However, if the same test object is used in other tests, you must update the name manually in those tests.
Add properties to a test object description
-
In the object repository tree of the Object Repository window or Manager, select the test object whose description you want to modify.
-
In the Test object details area, click the Add description properties button .
-
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.
Define a new description property
-
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.
-
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.
-
Click the Define new property button . The New Property Dialog Box opens.
-
In the New Property dialog box, provide details for your property and click OK.
Remove properties from a test object description
-
In the object repository tree of the Object Repository window or Manager, select the test object whose description you want to modify.
-
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.
-
Click the Remove selected description properties button . The selected properties are removed from the test object description.
Specify an ordinal identifier
-
In the object repository tree of the Object Repository window or Manager, select the test object whose ordinal identifier you want to specify.
-
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.
-
Click the Browse button. The Ordinal Identifier Dialog Box opens.
-
In the Ordinal Identifier dialog box, provide the ordinal details and click OK.
Define related objects for a specific test object
-
In the Visual Relation Identifier Settings row of the Object Repository window or Object Properties dialog box, click in the Value cell.
-
Click the Browse button in the cell. The Visual Relation Identifier Dialog Box opens.
-
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 One 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.
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.
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.
-
Open the test or component that contain the local object repository to which you want to copy the object.
-
Open the Object Repository window by selecting Resources > Object Repository or clicking the Object Repository button .
-
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.
-
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.
-
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.
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
Update test object description from the clipboard
If you have an object description in your clipboard, apply the entire description by pasting it into your test object.
You may want to do this when your test run has used Smart Identification to identify the object in your application, and has created a new object description based on the Smart Identification values.
Do the following:
-
Ensure that you have the new test object description in your clipboard.
For example, in an HTML report with Smart Identification values, click COPY NEW DESCRIPTION.
-
In the object repository window, select the object you want to update, and then click Paste in the toolbar.
The selected test object is updated with the new object description.