Create an external environment variables file

Relevant for: GUI tests only

This topic describes how to create an external environment variables file.

Note: This task is part of a higher-level task. For details, see Use user-defined external environment variables.

Create an external environment variable file in the Test Settings

  1. Define the variables in the Environment pane of the Test Settings dialog box (File > Settings > Environment node).

  2. Click Export to export the user-defined environment variables to an .xml file.

    For details, see Environment Pane (Test Settings Dialog Box).

Back to top

Create an external environment variable file manually

  1. Create an .xml file using the editor of your choice.

    You can use the UFT One environment variable file schema in:<UFT One installation folder>\help\QTEnvironment.xsd or follow the formatting instructions below.

  2. Enter <Environment>on the first line.

  3. Enter each variable name-value pair in between <Variable> elements using the following format:

    <Variable>

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

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

        <Description> This text is optional and can be used to add comments.

        It is shown only in the XML and not in UFT One</Description>

    </Variable>
  4. Enter </Environment> on the last line.

    <Environment>

        <Variable>

            <Name>Address1</Name>

            <Value>25 Yellow Road</Value>

        </Variable>

        <Variable>

            <Name>Address2</Name>

            <Value>Greenville</Value>

        </Variable>

        <Variable>

            <Name>Name</Name>

            <Value>John Brown</Value>

        </Variable>

        <Variable>

            <Name>Telephone</Name>

            <Value>1-123-12345678</Value>

        </Variable>

    </Environment>
  5. Save the file in a location that is accessible from the UFT One computer. The file must be in .xml format with an .xml file extension.

Back to top