Assigning test variable values from multiple datasets by using the Assign step
You can assign test variable values from multiple datasets to retrieve values from more than one dataset. This capability supports flexible data-driven testing across different scenarios and reduces the need to repeat test steps.
Before you begin
- Ensured that you are assigned a Team Space Owner, Project Owner, or Member with a Tester role to create or edit a test resource.
- Read and understood the information in Edit branch overview and Create or select an Edit branch.
- Ensured that your project contains a Web UI test.
- Ensured that the required variables have been created and are included in your Web UI test.
- Ensured that your project contains a dataset.
Procedure
- Open the required test in Test Editor.
-
Click the
button displayed on the Test
Editor page.
The Edit button appears only when no active edit branch is selected.
Alternatively, right-click the test in the test navigator panel and select Edit.
The Edit branch dialog is displayed.If the Edit branch is not displayed, then go to step 4. - Select an existing branch or create a new branch.
-
Drag the Assign statement from the pane and drop it under a test step as required.
The Assign step is inserted.Note:
You can also use the Assign step within a while or do-while step, so that the Assign step retrieves the values from a dataset to process each row of the dataset iteratively and assign the retrieved values to the test variables.
-
Click the Assign step.
The step details pane opens with the Details tab.
-
Perform the following steps to add multiple datasets:
- Click Add Variable to add a variable and assign the value from the dataset.
-
Select an existing variable from the Select a variable to
assign drop down.
The variable is displayed in the Variables section.
-
Click the drop-down icon
for the variable.
Note:You can also select Create variable from the list to create a new variable and assign the value from the dataset.The variables in the test and column names in the selected datasets are listed. - Select the column in the dataset from which you want to assign the values during test run.
-
Click the Close icon
to close the step details pane.
-
Click the Save icon
to save the
modifications.