Lesson 3: Create and add variables to a Web UI test

In this lesson, you will learn how to create and add test variables to store values and reuse them across test steps. By using variables, you can manage test data centrally and apply it dynamically during test execution.

Before you begin

Ensure that you have completed the previous lessons in this tutorial.

About this task

In the recorded test, the Employee ID value was manually entered as 012345. In this task, you will create a test variable to store a new Employee ID 23456 and modify the recorded test step to use this variable instead of the manually entered value. This method helps make the test more flexible and reusable by separating test data from test logic.

Procedure

  1. In the test steps list, click Configure settings and data.
  2. In the Variables section, click Create Variable.
  3. Enter a variable name. For example, new_EmployeeID.
  4. Enter the required value in the Value field. For example, 23456.
  5. Save the variable by clicking outside the Value field.

    The newly created variable is listed in the Variables section.

  6. Click the Close icon to close Configure settings and data.
  7. Perform the following actions to replace the Employee ID value in the recorded steps:
    1. Locate the recorded step that enters the Employee ID value (currently 012345).

      The step opens in the Details tab.

    2. In the Value field, replace the manually entered Employee ID with the variable. For example, ${new_EmployeeID}.
    3. Close the Details tab.
      The Employee ID step is modified to use a ${new_EmployeeID} value, as shown in the image.
  8. Click Save to save the modified step.

Results

You have now added the variable to the recorded step.

You have completed Lesson 3.

What to do next

In the next lesson, you will learn how to modify the test steps. See Lesson 4.