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

You must have completed the following tasks:
  • 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

  1. Open the required test in Test Editor.
  2. Click the Edit 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.
  3. Select an existing branch or create a new branch.
  4. Drag the Assign statement from the Catalog > General 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.

  5. Click the Assign step.

    The step details pane opens with the Details tab.

  6. Perform the following steps to add multiple datasets:
    1. Select an existing dataset in the Dataset field.
      This dataset acts as the primary dataset. The Add Dataset option is enabled.
    2. Click Add Dataset and select additional datasets.

      You can add multiple datasets as required.

      If you want to remove a dataset, you can click Remove Dataset from the dataset list.

  7. Click Add Variable to add a variable and assign the value from the dataset.
  8. Select an existing variable from the Select a variable to assign drop down.
    The variable is displayed in the Variables section.
  9. 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.
  10. Select the column in the dataset from which you want to assign the values during test run.
  11. Click the Close icon to close the step details pane.
  12. Click the Save icon to save the modifications.

Results

You have assigned multiple datasets to test variables in a test by using the Assign step.