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

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

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

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 One 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 One or the Object Repository Manager .

  2. In the Object Spy window, click the pointing hand. UFT One 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

Use the Capture function to capture all objects in a selected area of your application.

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

  2. In the toolbar, click the Capture button .

  3. In your application, select the top level object you want to capture.

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

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

See also: