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:
-
Create Parameters. You can manually create new Parameters or you can import Parameters into qTest.
-
Create Datasets. You can manually create new Datasets or you can import Datasets into qTest.
-
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.
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.
To call a Parameter in a Test Case:
-
Access the Test Case that you want to call a Parameter in.
-
In the Test Step that you want to call the Parameter in, 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. -
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.
-
To close edit mode, click anywhere outside of the Step Description edit box.
-
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.
To create Test Runs for a Test Case using Parameters:
-
On the Test Case screen, click Create Test Run.
The Create Test Run(s) modal appears.
-
On the Create Test Run(s) 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. -
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".
-
-
In the Create Run Data field, select one of the following methods for creating the Test Run data.
ManuallyIf you know the specific data you want for each Test Run, you can manually add individual values to each Test Run.
To manually add a value to a Test Run:
-
In the Add Test Runs field, select the number of Test Runs that you want to add, and then click the Add Test Run(s) button to add the Test Run rows to the grid.
-
In the column for each Parameter, select the value for the respective Test Run.
Randomize DataIf you want qTest to generate Test Runs using randomly selected values for each Test Run, you can indicate that Test Run data should be randomized.
To randomize Test Run data:
-
Select one of the following option buttons to indicate whether the randomized data should include unique data combinations only or unique values only.
-
Unique data combinations only. Each row in the data grid will be a unique combination of values. Parameter values can repeat; however, no two rows will have the same combination of values. This option is useful when you want to test every value in one Parameter set with every value in another Parameter set. The possible number of unique combinations that can be generated appears in parentheses to the right of the option.
-
Unique values only. Parameter values will not repeat and no two rows will have the same Parameter value. This option is useful when you want to test every value in a Parameter set but don't necessarily need to test them with each value in another Parameter set. The possible number of unique values that can be generated appears in parentheses to the right of the option.
-
-
In the Number of data combinations field, select the number of Test Runs that you want to generate.
-
(Optional) Click Preview Data to generate the data, which appears in the grid. This option is helpful if you want to check through the randomized values before creating the Test Runs.
From DatasetIf you have created a Dataset using the Parameters that are called in the Test Case, you can use the Dataset to create data for the Test Runs.
You can only use Datasets that include all Parameters called in the Test Case.To generate Test Runs using data from a Dataset:
-
In the Select a Dataset field, select the Dataset to use. The number of values in the Dataset appears to the right of the field.
-
If you know exactly which range of values in the Dataset you want to use, you can specify the range. In the From Row Number field, enter the row number you want to start values from. Then in the Number of Rows field, select the number of rows to add.
For example, suppose your Dataset includes 100 rows of values and that you know you want to use values 20 through 50. To indicate this, enter 20 in the From Row Number field and then select 30 in the Number of Rows field.
-
In the row above the Test Run grid, map the Parameters included in your Test Case with the corresponding Parameters in the Dataset.
-
(Optional) Click Preview Data to generate the data, which appears in the grid. This option is helpful if you want to check through the values before creating the Test Runs.
-
-
(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).
-
(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.
-
Click the Add button to create the Test Runs. The Test Runs are generated and then added to your selected location.