Storing output values

Relevant for: GUI tests and scripted GUI components

When you define an output value, you can specify where and how each value is stored during the run session.

Test and Action Parameters

You can output a value to an action parameter, so that values from one part of a run session can be used later in the run session, or be passed back to the application that ran (called) the test.

Example: Suppose you are testing a shopping application that calculates your purchases and automatically debits your account with the amount that you purchased.

You want to test that the application correctly debits the purchase amount from the account each time that the action is run with a different list of items to purchase.

You could output the total amount spent to an action parameter value, and then use that value later in your run session in the action that debits the account.

Back to top

Run-time Data Table

The option to output a value to the run-time data table is especially useful with a data-driven test, action, or scripted component that runs several times. In each repetition, or iteration, UFT retrieves the current value and stores it in the appropriate row in the run-time data table.

Example: Suppose you are testing a flight reservation application and you design a test to create a new reservation and then view the reservation details.

Every time you run the test, the application generates a unique order number for the new reservation. To view the reservation, the application requires the user to input the same order number. You do not know the order number before you run the test.

To solve this problem, you output a value to the Data pane for the unique order number generated when creating a new reservation. Then, in the View Reservation screen, you use the column containing the stored value to insert the output value into the order number input field.

When you run the test, UFT retrieves the unique order number generated by the site for the new reservation and enters this output value in the run-time data table.

When the test reaches the order number input field required to view the reservation, UFT inserts the unique order number stored in the run-time data table into the order number field.

Back to top

Environment Variables

When you output a value to an internal user-defined environment variable, you can use the environment variable input parameter at a later stage in the run session.

Example: Suppose you are testing an application that prompts the user to input an account number on a Welcome page and then displays the user's name.

You can use a text output value to capture the value of the displayed name and store it in an environment variable.

You can then retrieve the value in the environment variable to enter the user's name in other places in the application.

For example, in an Order Checkbook Web page, which for security reasons requires users to enter the name to appear on the checks, you could use the value to insert the user's name into the Name edit box.

Back to top