Use Parameters and Datasets

Once you have created Parameters and Datasets, you can use those variables to assign values to the Test Steps in your Test Cases, allowing you to quickly create multiple Test Runs with different data in each Test Run.

To use Parameters and Datasets in your Test Cases:

  1. Create Parameters. You can manually create new Parameters or you can import Parameters into qTest.

  2. Create Datasets. You can manually create new Datasets or you can import Datasets into qTest.

  3. Call Parameters in your Test Cases.

  4. Create Test Runs using Parameters and Datasets.

  5. Execute the Test Runs. There are multiple ways to execute Test Runs in qTest. For more information about executing Test Runs, refer to Execute Test Runs.

    A Test Run cannot be executed if its Test Case version includes a Parameter that is inactive, deleted, or does not have any values.

This topic includes procedures on calling Parameters in Test Cases and creating Test Runs using Parameters and Datasets.

Call a Parameter in a Test Case

Once you have created a Parameter, you can call the Parameter in a Test Case. Calling a Parameter adds the Parameter to a Test Step, which then functions like a variable or a placeholder for different values in that Parameter. You can add parameters to the step descriptions or expected results text of Test Steps.

For example, suppose you need to test logging in to your web application using five different usernames. Rather than manually creating five different Test Runs to test each username, you can call a Parameter that includes the usernames as values. When you then create Test Runs from the Test Case, qTest can automatically create five Test Runs, each with a step to test a different username.

Only Parameters that have been associated with a Project can be called in Test Cases in that Project.

To call a Parameter in a Test Case:

  1. Access the Test Case that you want to call a Parameter in.

  2. In the Test Step that you want to call the Parameter in, click the Step Description field or the Expected Result field to edit the text of the step description or the expected result, respectively.

  3. In the text edit box, type an @ (at sign). Then type the identifier of the Parameter that you want to call. As you type, identifiers that match the entered text appear in a list.

    This functionality can be helpful if you don't remember the exact identifier of the Parameter. For example, typing "login" will display any Parameters with "login" in the identifier, such as "Login Usernames" or "Login Passwords".

    Up to 10 Parameters display in the list. To load more Parameters in the list, scroll through the list using the Up Arrow or the Down Arrow on your keyboard.

  4. Select a Parameter from the list.

    You must select a Parameter from the list to call the Parameter. If you only type the name of the identifier, the Parameter will not be called, even if the full identifier is used and is correct. If a Parameter has been correctly called, the Parameter appears in @identifier format and is linked to the Parameter information in qTest Parameters.

  5. To close edit mode, click anywhere outside of the text edit box.

  6. Click Save to save your changes.

Create Test Runs using Parameters and Datasets

Once you have approved any Test Cases that include Parameters, you can create Test Runs for the Test Case. When creating Test Runs from Test Cases that call Parameters, you will need to add Parameter values, which can be done manually, by randomizing data, or automatically from a Dataset.

Test Run configurations will not be applied to Test Runs created from Test Cases using Parameters.

To create Test Runs for a Test Case using Parameters:

  1. On the Test Case screen, click Create Test Run.

    The Create Test Run(s) modal appears.

  2. On the Create Test Runs modal, select the Release, Test Cycle, or Test Suite that the new Test Runs should be added to. Then click Select.

    The Create Test Runs dialog appears.

    You can change the Release, Test Cycle, or Test Suite that the Test Runs should be added to, if needed, by clicking the Modify button on the Create Test Runs dialog.
  3. In the Test Run Naming Convention section, select one of the following methods to use for naming the Test Runs.

    • System default. The Test Runs will be named using the Test Case name, appended with incremental numbers.

      For example, three Test Runs created for a Test Case named "Login" would be named "Login 1", "Login 2", and "Login 3".

    • Customize Test Run Name. In the text box, enter @ (at sign), and then select a Parameter from the list that appears. The values for this Parameter will be used as the Test Run names.

      For example, suppose a Parameter named "@Login Usernames" includes the following values: User1@email.com, User2@email.com, User3@email.com. The Test Runs created for this Test Case will be named "User1@email.com", "User2@email.com", and "User3@email.com".

  4. In the Create Run Data field, select one of the following methods for creating the Test Run data.

  5. (Optional) Select the Do not add duplicate Test Runs in the same location check box. This option prevents a duplicate Test Run from being added if the Test Run has the same Test Case version and the same set of Parameter values as an existing Test Run in the same location (the selected Release, Test Cycle, or Test Suite).

  6. (Optional) Select the Do not add duplicate Test Runs check box. This option prevents a duplicate Test Run from being added if the Test Run has the same Test Case version and the same set of Parameter values as any Test Run in your qTest Project, regardless of location.

  7. Click the Add button to create the Test Runs. The Test Runs are generated and then added to your selected location.