RFT Test Object Maps

Introduction

As Applications undergo changes throughout the course of development, the Automated scripts can ‘break’.
Testers must constantly update the scripts to handle minor changes in the application.
Instead of updating the script code, the Test Object map can be updated. All Scripts that reference this object map can ‘see’ the update.

Test Object Map

RFT Test Object Map

1. Test Object Map is a hierarchical collection of descriptions of test objects.
Contains properties (name-value pairs) for each test object
2. Recognition properties enable Functional Tester to find the test object during playback.
3. Administrative properties describe the test object.
4. While performing recording action in an AUT it creates a Test script and the corresponding Test Object Map. The Test Object Map can be seen in the Script Explorer Perspective

Scripts and Test Object Maps

A Script is always associated with a single test object map
A test object map can be:

Private

Associated with only one script
Automatically created while recording an AUT

RFT Private Test Map

Shared

Can be associated with more than one script
Automatically updated when recording a script

RFT Shared Test Map

Private Test Object Map

1. Private test object map is used to isolate test object differences within a single script.
2. Associated with only one script
3. Displayed by the script explorer
4. Deleted when the script is deleted

RFT Private Test Object Map

Shared Test Object Map

1. Shared test object map is used to share the test objects along multiple scripts.
2. A Private test object map cannot be converted to a Shared test object map. Instead a Private test object map can be merged to a new or existing Shared test object map.

RFT Shared Test Object Map

Displaying a Test Object Map

To open a shared test object map from the Project Explorer:
1. Double-click the test object map
2. Right-click the test object map and select Open Test Object Map
3. To open a test object map (private or shared) from the Script Explorer:
4. Double-click the test object map
5. Right-click the test object map and select Open
6. Click the Open Test Object Map button on the toolbar

RFT Open Test Object Map

Creating a Shared Test Object Map

To create a test object map that can be shared:

1. On the menu bar, click File > New > Test Object Map.
2. In the Create a Test Object Map dialog, specify the following and then click Next.

a. Location of the test object map
b. Name of the map
c. Whether you want to add the map to Clear Case version control
d. Whether you want this test object map to be the default choice for new Functional Tester scripts

RFT Create Test Object Map

3. In the Copy Test Objects to New Test Object Map dialog, select the way you want to populate the new test object map:
a. To create an empty map with no objects, choose Don’t copy any Test
Objects.
b. To create a map using an existing test object map as a template, click Select Test Object Maps and scripts to copy Test Objects from and then select the maps and scripts you want to base the new map on.
If you have selected scripts and want to associate those scripts with the new map, click Connect selected Functional Tester scripts with new Test Object Map.
4. Click Finish.

RFT Copy Test Object to New Test Object Map

Associating a script with a Shared Test Object Map

To associate a new Functional Tester script with a shared test object map:
1. Click Record a Functional Test script.
2. Complete the Record a Functional Test script dialog and click Next.
3. In the Select Script Assets dialog box, click the Test Object Map Browse button and select the map to be associated with the script.
4. In the Select Test Object Map dialog, select the shared test map you wish to associate with the new script and then click OK.
5. Click Finish in the Select Script Assets dialog.

RFT Associate New Script to Shared Test Object Map

Adding an object to a Test Object Map

1.In the test object map menu, click Applications > Run and select the application that contains the object you want to add to the test object map. This opens the application. (If necessary, add the application.)
2. Click Test Object > Insert Object(s)…. Functional Tester displays the Insert a GUI Object into the Object Map dialog box.

RFT Insert GUI Object into the Object Map

3. In the Insert a GUI Object into the Object Map dialog box, click the Object Finder icon and drag it over the object you want to add to the test object map.

RFT Object Finder

4. After selecting the object to add, its properties will be displayed. Click Next to continue.
5. On the Select Object Options page, specify what to include:
a. Just the selected object
b. All siblings of the selected object
c. All available objects in the window
6. Click Back to add more objects or click Finish.
7. In the Test Object Map, click File > Save to save the updated test object map.

RFT Adding an object to a Test Object Map

Adding Test Objects to a script

To add a test object to a script:
1. Click Test Object > Associated Scripts.
2. Select the scripts to which you want to add the test object and then click OK.
3. Click Test Object > Add to Script [name of script1]… Functional Tester adds the test object to the Script Explorer of the selected script.

RFT Adding Test Objects to a Script

4. In the script, position the cursor where you want to add the object.
5. In the Script Explorer, right-click the object you want the script to reference. In the drop-down menu, select Insert at Cursor. Functional Tester displays a list of all possible methods for the object.
6. Double-click the method you want to use. Functional Tester inserts the object and the method you selected into the script at the cursor location.

RFT Insert at cursor

Updating Properties of Test Objects

To edit object properties:
1. In the Test Object Map, select the object.
2. In the property sets pane, double-click the value you want to edit. Properties that cannot be edited are labeled “(read only).“

RFT Updating properties of Test Objects

To add descriptive text to an object’s Administrative property set:
1. Right-click the object and select Description Property.
2. In the Set Description Property dialog, enter the text you want to use for the
object‘s description property. If a description property already exists for this test object, you can edit it.
3. Click OK.

RFT Set Description Property

Deleting an Object from a Test Object Map

To remove an object from a test object map:
1. In the test object map, select the test object to be deleted.
2. Do one of the following:
a. Right-click and select Delete.
b. On the test object map toolbar, click the Delete button.
3. In the Delete Test Object dialog box, do one of the following:
a. Click Next to list all of the scripts that reference the test object and that will be affected by the deletion.
b. Click Finish to delete the object from the test object map.
c. Click Cancel to close the dialog box without deleting the test object.

RFT Deleting an Object from a Test Object Map

You Should Also Check Out This Post:

More Active Posts: