Add a test object to an object repository

Relevant for: GUI tests and components

This task describes how to add test objects to local or shared object repositories. This functionality is available in the Object Repository window for the local object repository, and the Object Repository Manager for shared object repositories.

Add test objects to the object repository

  1. Perform one of the following:

    To add to the local object repository In the Object Repository window, Select Object > Add Objects to Local or click the Add Objects to Local toolbar button
    To add to a shared object repository

    In the Object Repository Manager, select Object > Add Objects or click the Add Objects toolbar button

    UFT and the Object Repository window or Object Repository Manager are hidden, and the pointer changes into a pointing hand. In some environments, as you move the pointing hand over your application, the test objects are highlighted.

  2. In your application, click the object you want to add to your object repository.

  3. If the location you click is associated with more than one object, the Object Selection Dialog Box opens. Select the object you want to add to the repository and click OK.

    If the selected objects is the bottom of the hierarchy The object is added directly to the object repository.
    If the selected object is a parent (container) object the Define Object Filter Dialog Box opens. The Define Object Filter dialog box retains the settings that you defined in the previous add object session.

    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.

Back to top

Add an Insight test object to the object repository

For details, see Add an Insight object.

Back to top

Add a test object to the local object repository while adding a step

  1. In the Item cell of the Keyword View, from the drop-down list, select Object from repository.

  2. In the Select Test Object Dialog box, select the object to add.

  3. 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.

Back to top

Define a new test object

  1. Select the object under which you want to define the new object, according to the correct object hierarchy.

  2. Click the Define New Test Object button or select Object > Define New Test Object. The Define New Test Object Dialog Box opens.

  3. In the Environment drop-down list, select the UFT add-in environment for your object.

  4. In the Class drop-down list, select the object type.

  5. In the Name edit box, give the object a name.

  6. In the Test Object details area, provide the necessary description properties for the object.

  7. Click Add to insert the new object in the object repository.

  8. Click Close to return to the main object repository window.

Back to top

Add a test object to the object repository with the Object Spy

  1. Click the Object Spy button from UFT or the Object Repository Manager.

  2. In the Object Spy window, click the pointing hand. UFT is minimized.

  3. 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.

  4. In the Object Spy, select the appropriate object from the hierarchy to add.

  5. 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.

Back to top

Add a test object by capturing all objects

Using the Capture functionality, you can capture all the objects in a selected area of your application simply by selecting the area of the application.

  1. Open your application to the correct page, window, or section of the application.

  2. In the toolbar, click the Capture button . The UFT window is minimized and the Capture dialog box is opened.

    Note: There is no need to use or click on the Capture dialog.

  3. In your application, select the top-level object from which to capture objects. The mouse pointer changes into a crosshairs:

  4. Click once to select the first border point for the application and drag to select the necessary area in your application.

  5. Release the mouse button. UFT 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.

  6. Save your test and local object repository.

Back to top

Add a test object to the local object repository from the Active Screen

  1. If the Active Screen is not displayed, select View > Active Screen.

  2. Select a step in your test whose Active Screen contains the object that you want to add to the object repository.

  3. In the Active Screen, right-click the object you want to add and select View/Add Object.

  4. 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.

  5. The Object Properties Dialog Box opens and displays the default description properties for the object.

Back to top

Add a test object to the local object repository by inserting a step from the Active Screen

  1. If the Active Screen is not displayed, select View > Active Screen.

  2. Select a step in your test whose Active Screen contains the object for which you want to add a step.

  3. 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, Step Generator, and so forth).

  4. 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.

  5. 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).

Back to top

Add a test object to the local object repository by adding a step from the Object Spy

For details, see Add objects directly to a test or component.

Back to top