Wednesday 5 March 2014

Different ways to add Test Object to Object Repository

There are multiple ways to add test object to Object Repository in QTP.

1.    Record a test step.
2.    Add object to local.
3.    Create a test object by using define new test objects.
4.    Creating an Object Description.
5.    OR Manager Navigate and Learn or Add object option.
6.    Adding test objects to local object repository from Active Screen.

Recording a test step

Test objects are created automatically and added to the local OR when a user records
a step. Add object to local.

Adding a test object to OR

Add a test object to the local OR through the following steps:
1. Navigate to Resources | Object Repository | Add object to local.
2. Click on the button Add Object to local.
3. Click on the hand pointer to the object we want to add from AUT
4. Click on OK.
Create a test object by using define new test objects

To define a new object, we should know its class and its identification properties.
Perform the following steps:
1. Navigate to Resources | Object Repository | Define New Test Object.
2. Filter Environment from the Define New Test Object window.
3. Select the class from the Class drop-down box.
4. Enter a logical name.
5. Provide the value for the Identification property (1 to n).
6. If required, add some identification properties.
7. Click on the Add button to add a test object to the OR.

Creating an Object Description

The test object can be created without recording, by providing an object description.

We can use the object description in the test steps directly, as shown in the following
code:
Window("regexpwndtitle:=FlghtReservation").WinComboBox("attached
text:=Fly From:").Select "London"


OR Manager Navigate and Learn or Add object option

The Navigate and Learn toolbar

This toolbar allows you to add multiple test objects to a shared object repository
while you navigate through your application. Following are the steps to learn to
navigate the object in the object repository manager:

1. Navigate to Resources | Object Repository Manager | Object | Navigate
and Learn or press F6.


2. Select a window to learn. The selected window and its descendant objects
are added to the active shared object repository according to a predefined
object filter.

Adding a test object using the OR Manager Add Object option

1. Navigate to Resources | Object Repository Manager | Objects | Add
Object. Click on the hand pointer and select the window.

2. The object filter is used for the Navigate and Learn option as well as the Add
Objects option.

Adding test objects to the local object repository from Active Screen

Select the required object from Active Screen and add it to the object repository. In
order to add test objects to the object repository using Active Screen, Active Screen
should have the object. Perform the following steps:

1. Go to the Active Screen pane.
2. Select an object and right-click on it.
3. Click on View / Add Object.
4. Click on the Add to Repository button.

No comments:

Post a Comment