Add a test object to an object repository
Relevant for: GUI tests and components
This topic describes how to add test objects to local or shared object repositories, either from the Object Repository window for the local object repository, or the Object Repository Manager for shared object repositories.
Add test objects to the object repository
-
Click the Add Objects / Add Objects to Local toolbar button .
UFT One is hidden and the pointer changes to a pointing hand. In some environments, test objects are highlighted as you hover over your application.
-
In your application, click the object you want to add to your object repository.
-
If the location you click is associated with more than one object, select the object you want to add from the ones displayed in the Object Selection Dialog Box .
- If the selected object is the bottom of the hierarchy, the object is added directly to the object repository.
- If the selected object is a parent object, define the child objects you want to add in the Define Object Filter Dialog Box.
The new object's parent objects are also added, if they do not already exist in the object repository.
Local objects are shown in black in the object repository tree to indicate they are editable; shared objects are shown in gray and can be edited only in the Object Repository Manager.
Add a test object to the local object repository while adding a step
-
In the Item cell of the Keyword View, from the drop-down list, select Object from repository.
-
In the Select Test Object Dialog box, select the object to add.
-
Click OK to create a step using the selected object.
The selected step is added to the test and the object is added to the action or component's local object repository.
Define a new test object
-
Select the object under which you want to define the new object, according to the correct object hierarchy.
-
Click the Define New Test Object button or select Object > Define New Test Object. The Define New Test Object Dialog Box opens.
-
In the Environment drop-down list, select the UFT One add-in environment for your object.
-
In the Class drop-down list, select the object type.
-
In the Name edit box, give the object a name.
-
In the Test Object details area, provide the necessary description properties for the object.
-
Click Add to insert the new object in the object repository.
-
Click Close to return to the main object repository window.
Add a test object to the object repository with the Object Spy
-
Click the Object Spy button from UFT One or the Object Repository Manager.
-
In the Object Spy window, click the pointing hand. UFT One is minimized.
-
In your application, click on the object you want to add. The properties of the object are displayed in the main part of the Object Spy window.
-
In the Object Spy, select the appropriate object from the hierarchy to add.
-
Click the Add Object button . Depending on from where you opened the Object Spy dialog box, the object is added to the local or shared object repository.
Add a test object by capturing all objects
Use the Capture function to capture all objects in a selected area of your application.
-
Open your application to the correct page, window, or section of the application.
-
In the toolbar, click the Capture button .
-
In your application, select the top level object you want to capture.
-
When the mouse pointer changes into a crosshairs, click and drag to select the area that contains the objects you want to capture.
UFT One displays a flashing rectangle around the selected area of your application, and pauses while it learns the objects.
The learned objects are added to the action's local object repository.
Add a test object to the local object repository from the Active Screen
-
If the Active Screen is not displayed, select View > Active Screen.
-
Select a step in your test whose Active Screen contains the object that you want to add to the object repository.
-
In the Active Screen, right-click the object you want to add and select View/Add Object.
-
If the location you clicked is associated with more than one object, the Object Selection Dialog Box opens. Select the object you want to add to the object repository, and click OK to close the Object Selection dialog box.
-
The Object Properties Dialog Box opens and displays the default description properties for the object.
Add a test object to the local object repository by inserting a step from the Active Screen
-
If the Active Screen is not displayed, select View > Active Screen.
-
Select a step in your test whose Active Screen contains the object for which you want to add a step.
-
In the Active Screen, right-click the object for which you want to add a step and select the type of step you want to insert (checkpoint, output value, or Step Generator).
-
If the location you clicked is associated with more than one object, the Object Selection Dialog Box opens. Select the object for which you want to add a step, and click OK.
The appropriate dialog box opens, enabling you to configure your preferences for the step you want to insert.
-
Set your preferences and select whether to insert the step before or after the step currently selected in the Keyword View or in the Editor. Click OK to close the dialog box. A new step is inserted in your test, and the object is added to the local object repository for the current action (if it was not yet included).
See also: