LoadFromFile Method

Description

Loads the specified environment variable file. The environment variable file must be an XML file using the following syntax:

<Environment>

    <Variable>

        <Name>This is the first variable's name</Name>

        <Value>This is the first variable's value</Value>

    </Variable>

</Environment>

For more information about environment variable files, see the UFT One User Guide.

Syntax

Environment.LoadFromFile(Path, [SaveWithTest])

Argument

Type

Description

Path
String
The path of the environment file to load.
SaveWithTest

 

 

UFT versions 14.52 and later

Boolean

Optional. Indicates whether to save the loaded environment variable file with the test when the script saves the test.

Possible values: 

  • True
  • False (Default)

Example

The following example loads the MyVariables.xml file and does not save it with the test.

Environment.LoadFromFile("C:\UFT\Files\MyVariables.xml")