Linking datasets to a functional test script
You can link datasets to a functional test script to override the existing dataset that is associated with the script. To link a dataset, you must include the functional test script in a compound test in the UI Test perspective, and then map the required dataset by using Dataset Mapper.
Before you begin
- Created a functional test that has an associated dataset. See Data-driving functional tests.
- Created at least one dataset. See Creating a dataset in a workspace.
- Read and been familiar with adding dataset mapper. See Adding Dataset Mapper.
About this task
If the compound test includes a Dataset Mapper that retrieves values from one dataset
and a test in the compound test is also associated with another dataset, the run
uses both the datasets.
Note: When you run the compound test with a Dataset Mapper,
the test picks up the dataset values from the first row. For the test to pick up
all the dataset values, you must put the test in a loop.
Procedure
- Open the UI Test perspective in HCL OneTest™ UI if it is not already open.
-
Right click on the project from the Test Navigator pane
and perform the following actions:
- Go to
The New Compound Test pane is displayed.
. - Enter a file name for the test, and then click Finish.
- Click Finish.
The file extension testsuite is added to the file name and the compound test is created under Compound Tests folder of the selected project.
- Go to
-
Click Add in the Compound Test window, and
then select Test.
The Select Tests window is displayed with all the projects in workspace.
- Select the functional test that has a dataset for linking a new dataset.
-
Click OK.
The test is added to the compound test.
- Save the compound test by clicking .
- Click in the compound test editor.
-
Select a dataset to use for the test in the Select
Dataset dialog, and then click OK.
In the Columns mapping table, the Column is automatically filled with the column names from the dataset. By default, the variable names are also created with the same names as the dataset columns.
- Click the cell in the Columns mapping table, and then click the Ellipsis button and select the variable if you want to use the variable names from the test.
- Optional: Click Browse and select another dataset in Dataset Mapper Details if you want to change the dataset after it is associated.
- Select the Dataset Mapper, and then click to fetch all the dataset values by using a loop.
- Save the changes.