Add test objects to an object repository
Relevant for: GUI tests and components
This topic describes how to add test objects to local or shared object repositories.
Overview
You can add test objects to an object repository in various ways:
-
Use the Navigate and Learn option to add objects to the shared object repository
-
From the Object Repository window for the local repository or the Object Repository Manager for the shared repository.
-
Add test objects to the local object repository while editing your test or component.
-
Use the Object Spy or Object Identification Center (OIC) to spy on objects and add them to the object repository.
-
Record steps to add objects on which you perform an operation to the local object repository. (This occurs for objects that do not already exist in an associated shared object repository.)
-
Use the Capture function to capture objects and add them to the local object repository.
-
Add tests objects from the Active Screen or while inserting steps from the Active Screen.
When you add test objects to an object repository, you can choose to add only a selected test object, to add all test objects of a certain type (such as all button objects), or to add all test objects of a specific class (such as all WebButton objects).
Add test objects using Navigate and Learn
Use the Navigate and Learn option to learn test objects and add the learned objects to a shared object repository. For details, see Add test objects using Navigate and Learn.
Add objects from the Object Repository window or Object Repository Manager
Add test objects to a local object repository from the Object Repository window or to a shared object repository from the Object Repository Manager.
To add test objects:
-
Click the Add Objects / Add Objects to Local toolbar button .
OpenText Functional Testing 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 while editing a step
Add a test object to your local repository while editing your test or component.
To add a test object:
-
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
Define a test object and add it to the object repository.
To 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 OpenText Functional Testing 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 with the Object Spy or OIC
Use the Object Spy or OIC to spy on a test object and add it to your object repository.
To add a test object with the Object Spy or OIC:
-
Click the Object Spy button or OIC button from OpenText Functional Testing toolbar or the toolbar in the Object Repository window or Object Repository Manager.
-
Spy on an object and add it to the object repository. See Add objects to the object repository or Add objects to an object repository.
Add test objects by capturing all objects
Use the Capture function to capture all objects in a selected area of your application.
To add test objects by capturing:
-
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.
OpenText Functional Testing 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 from the Active Screen
Use the Active Screen to add a test object to your object repository.
To add a test object 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 by inserting a step from the Active Screen
Use the Active Screen to insert a step and add a test object into your object repository.
To add a test object by inserting a step:
-
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: