Relative paths for test resources

Relevant for: GUI tests and components

Relative paths are useful if your test's resources are stored in the file system and you want other users or products to be able to run this test on other computers.

During a run session, UFT One searches for the resource file in the folder for the current test or component, and then in the folders listed in the Folders pane of the Options dialog box (Tools > Options > GUI Testing tab > Folders node).

Note:  

  • On all computers that use the same test or component, make sure the relevant folders are listed in the Options dialog box and exist in the expected location.

    In some cases, you may need to define the folders automatically. For example, if you check the tests out of a version control system, to run in a CI/CD server job or task. In such cases, you can set the folders using an AOM script that you run in a preliminary step of your CI/CD server process.

    You can create the AOM script by defining the folders in the Options dialog box and then clicking the Generate Script button.

  • If you are working with the Resources and Dependencies model with ALM, specify an absolute ALM path.

  • To view the full path to your test resource, you can either hover over the resource in Solution Explorer and view the location from the tooltip or select the resource in Solution Explorer and view the location from the Properties pane.

When you specify a resource while editing a test or component, UFT One prompts you to do one of the following:

Define the path
using the relative path

This occurs if the resource path you specify matches an existing search path in the Folders pane.

For example:

If part of the path you enter matches more than one path in the Folders pane, the closest match is applied.

For example, if both C:\Current_Version and C:\Current_Version\Libraries are defined in the search path list, the latter is applied.

Add the resource's
location path to the
Folders pane /
define the path relatively

This occurs if the resource path you specify does not match an existing search path in the Folders pane.

For example: