Lesson 3: Add an execution variable to a test script

In the previous lesson, you edited the test script, (Engineering Test Management Tutorial) Allocate Dividends to Multiple Causes, by adding test data to a statement. In this lesson, you continue as the tester and create and add a test execution variable.

About this task

You can use an execution variable to provide consistent values in test runs. In this lesson, you create a test execution variable and add it to the test case that is associated with that test script. When the execution variable is defined, you can use it to provide a particular value for any test script that is associated with that test case.Create an execution variable in a test case and add it to a test script:

Procedure

  1. If you are not already logged in as the tester, log in by entering tanuj as both the user ID and password.
  2. Return to the (Engineering Test Management Tutorial) Donor can choose to support multiple organizations test case.
    Tip: If the test case is not already open, click Construction > Browse > Test Cases. In the section that opens, click (Engineering Test Management Tutorial) Donor can choose to support multiple organizations.
  3. Open the Execution Variables section of the test case.
  4. Create an artifact execution variable:
    1. For the type, select Artifact Variable.
    2. Click Create Execution Variable.
    3. Name the variable Authenticator code and enter its value as 5309.
    4. Click Create, and then click Save.
    A new artifact execution variable, Authenticator code, is added to the test case.
  5. Add the execution variable to the test script:
    1. Open the (Engineering Test Management Tutorial) Allocate Dividends to Multiple Causes test script.
      Because the script is associated with this test case, you can find it in the Test Scripts section of the test case.
    2. Click the Show Execution Variables View icon. For the type, select Artifact Variable, and then click Create Execution Variable.
    3. Pass the test case execution variable value to this script by reusing its name here. In the Name field, enter Authenticator code. Leave the Value field blank.
      The Execution Variables view.
    4. In step 4 of the test script, highlight the code 0000. In the Execution Variables view, select check box next to the Authenticator code variable. Then, click Insert Execution Variables in Current Step.
      An execution variable that is inserted into a test script step.
    1. Save the test script.
    The execution variable is added to the test script.

Results

An artifact execution variable is created in the test case. That variable is also added to a test script that is associated with the test case. Later, during test execution, the variable value that was defined in the test case is shown in the test script step where you inserted the variable.

Lesson checkpoint

n this lesson, you learned how to do these tasks:
  • Create an execution variable.
  • Insert an execution variable into a test script.

What to do next

In the next lesson, you continue as the tester to create a keyword from existing steps in a script and replace the steps with the keyword.