Maintain test objects in an object repository
Relevant for: GUI tests and components
This topic describes different tasks for maintaining test objects in your object repository.
Specify a property value
This task describes how to specify a property value of a test object.
To specify a property 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:
-
To specify a constant value, enter it in the value cell.
-
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, OpenText Functional Testing trims leading and trailing spaces.
Update description properties
This task describes how to update description properties of a test object.
To 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 . OpenText Functional Testing 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 OpenText Functional Testing when you clicked the object in your application.
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
This task describes how to restore description for a test object.
To 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
This task describes how to rename a test object.
To rename a test object:
-
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, OpenText Functional Testing 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.
Delete unused objects
This section describes how to clean up your local object repository by deleting unused objects from the repository.
Before you begin
This operation deletes objects whose names are not currently used directly in the test. Carefully consider the list of objects to be deleted before you confirm the operation. If you delete objects that the test needs when it runs, the test will fail.
Objects that the test needs, but are considered "unused" by OpenText Functional Testing:
-
Objects that are referenced indirectly:
-
The test uses variables to specify the object's description properties. For example:
var i = 1 logical_name = "my"&i window(logical_name).close
-
The test calls a function library function that references the object.
-
-
Objects used in steps that were commented out at the time of deletion, but uncommented when the test runs.
To delete unused objects:
-
In the toolbar of the Object Repository window, select Local Object as the filter to display all local objects in your repository.
-
Click the Delete Unused Objects button .
A list of objects to be deleted is displayed.
-
Make sure your test does not need any of these objects. Then click Delete to confirm the operation.
-
The deletion takes effect only when you save the test to which the object repository belongs.
Add properties to a test object description
This task describes how to add properties to the description of a test object.
To 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
This task describes how to define a description property for a test object.
To define a 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
This task describes how to remove properties from a test object description.
To 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
This task describes how to specify an ordinal identifier.
To 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
This task describes how to define related objects for a test object.
To define related objects for a 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 unavailable in the Object Details area of the local or shared object repository, and is not used during the object identification process. However, OpenText Functional Testing 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 file name 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.
To copy an object 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.
To paste a new test object description:
-
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.