Using relative paths when calling external / reusable Actions

Using relative paths when calling Actions

1. Go to Tools > Options

2. Select the Folders tab. Note: on UFT, this option is available under "GUI Testing" and only while GUI Test is open.

3. Add the path to the folder to search the tests / components / actions / files on.

Note:If you define folders here, you do not need to designate the full path of a test, component, action, or file in other dialog boxes or call statements. The order of the search paths in the list determines the order in which the mechanism searches for a specified action or file.

4. Click <OK>

5. Go to Insert / Design > Call to Existing Action.

6. In the From test field, select or enter the path to the reusable Action. Use the "Browse" button to navigate to the directory, if necessary.

7. Replace the absolute path with the relative path.

8. Click <OK>.

Note:This recording was created with QTP 9.0, however core steps remain the same on later versions, including Unified Functional Testing.

To verify the path (QuickTest Professional only):

1. Switch to Keyword View.

2. Right-click on the reusable Action.

3. Select Action Properties from the pop-up menu.

The path will be displayed in the Location field. Note: on UFT, the Properties sheet/pane displays the same "Location" property when selecting the action on the Test Flow chart, however shows full path(even if inputted as relative) as sign that it is working fine, however if folder reference is removed or does not exist, "Action is missing…"error appears.