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).
Specify the resource path type
You can specify to always save your test's resources with relative paths in the Folders pane. In this way, you do not need to get prompted every time you add a resource to your test. For details, see Specify the resource path type.
Remind me to use relative paths when specifying resources
If you select Ask me when I specify a path, UFT One prompts you to do one of the following when you add a resource to your test or component:
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:
|
Important notes
-
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 locations.
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, 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.