Add test objects to a component with Capture
Relevant for: business process tests or flows
This task describes how to add test objects to a component by scanning the application and capturing the application's objects into an object repository. This enables you to add the test objects in one step without having to first create and populate an object repository and then associate that object repository to the component's application area.
Note: This task is part of a higher-level task. For details, Create test steps in a business process test.
Prerequisites
Add a business component to the solution and open it.
Set Capture options
In the BPT General options pane of the Options dialog (Tools > Options > BPT Testing tab > General node), select the Automatically open Object Repository after Capture option if you want to edit the test object information after the object capture.
When the object repository opens after the application capture, you can modify the object names and properties as needed to suit your needs.
Capture the test objects in the application
-
In the Solution Explorer pane, select the component in which you want to include the captured objects.
-
In the toolbar, click the Capture button . The Capture toolbar opens.
-
(Optional) In the Capture toolbar, press the Define Object Filter button .
-
(Optional) In the Define Object Filter dialog box, select the level of detail to capture:
Selected object only Captures the selected object's properties and values, without its descendant objects. Default object types Captures the selected objects' properties and values, with the properties and values of its descendant objects according to the object types specified by the default filter. You can see which objects are in the default filter by selecting Selected object types, clicking the Select button, and then clicking the Default button. All object types Captures all of the application page or window's objects, including the object properties and values, together with the properties and values of all of its descendant objects. Selected object types Adds to the object repository the previously selected object's properties and values, as well as the properties and values of its descendant objects according to the object types and classes you specify in the object filter. You specify the objects and classes in the filter by clicking the Select button and selecting the required items. -
Select the top level object for which you want to capture its test objects (i.e. a Browser window, or an application screen).
-
In the Capture toolbar, click the Capture button.
The application flickers and the Adding Objects message box is displayed as UFT One captures representations of the objects on the page to the local object repository.
-
Click the Close button.
If you selected the option to automatically open the Object Repository after an application capture, the local object repository opens, displaying the captured objects. These test objects are stored in the component's local object repository and are available to use in the component test steps.
Capture a selected area of the application
-
In the Solution Explorer pane, select the component in which you want to include the captured objects.
-
In the toolbar, click the Capture button . The Capture toolbar opens.
-
(Optional) In the Capture toolbar, press the Define Object Filter button .
-
(Optional) In the Define Object Filter dialog box, select the level of detail to capture:
Selected object only Captures the selected object's properties and values, without its descendant objects. Default object types Captures the selected objects' properties and values, with the properties and values of its descendant objects according to the object types specified by the default filter. You can see which objects are in the default filter by selecting Selected object types, clicking the Select button, and then clicking the Default button. All object types Captures all of the application page or window's objects, including the object properties and values, together with the properties and values of all of its descendant objects. Selected object types Adds to the object repository the previously selected object's properties and values, as well as the properties and values of its descendant objects according to the object types and classes you specify in the object filter. You specify the objects and classes in the filter by clicking the Select button and selecting the required items. -
Select the top level object for which you want to capture its test objects (i.e. a Browser window, or an application screen).
-
In the Capture toolbar, press the Capture Area button. The mouse pointer turns into a crosshairs.
-
In your application, draw a box around the area to capture.
The application flickers and the Adding Objects message box is displayed as UFT One captures representations of the objects on the page to the local object repository.
-
Click the Close button.
If you selected the option to automatically open the Object Repository after an application capture, the local object repository opens, displaying the captured objects. These test objects are stored in the component's local object repository and are available to use in the component test steps.
Open the object repository for editing
If you did not select the option to automatically open the object repository after the application capture, you can still edit the object repository after capturing the objects.
-
In the Solution Explorer, expand the node of your component.
-
Under the component node, double-click the Local node. The Object Repository window opens.
-
In the Object Repository, edit the names and properties of the objects as needed.
Export the local object repository
You may sometimes want to export the captured objects in the local object repository to a shared object repository which can be used by other components.
-
In the Object Repository window, select File > Export Local Objects.
-
In the Save dialog, select the location in which to save the exported object repository. (This object repository is automatically saved as a shared object repository with a .tsr extension.)
-
Click Create. The local object repository is now saved as a shared object repository which can be added to other components and application areas.