Test Case Data Binding
Create a CSV Test Data File
-
Open the Excel and edit data in the format below. The first row is the key name of the data.
-
Save the Excel file to the CSV format on your local disk.
Notes:
The first column name must be datasetName, IDA uses the first column values to define the dataset name for each row.
Notes:
If you are experiencing CSV content character error, you need to save the CSV file as UTF-8 format.
Here are the steps for saving a CSV file as UTF-8 in Notepad:
- Open the CSV file with Notepad.
- Navigate to File > Save As option. A screenshot of the menu is as shown below:
- Next, select the location for the file. The Save As window appears as shown below:
- Select the Save as type option as All Files(.).
- Specify the file name with .csv extension.
- From the Encoding drop-down list, select the UTF-8 option.
- Click Save to save the file.
Upload Test Case Data
-
Click the + button from the Test Data files folder in the left menu sidebar.
-
Choose the CSV file you want to upload.
-
After upload, new test case data files will appear on the left menu sidebar.
-
You can also click the download icon to download it and check the content.
Delete Test Case Data
- Click the delete button to delete this test data.
Notes:
If the test case data has already been bound to some test cases, you need to remove the data reference from these test cases, then remove this test data.
Bind Data to the Test Case
-
Click the test case name to see the detailed case step page.
-
Click the edit button to edit this test case.
-
Bind the CSV data file name from the “Bind External File” select box.
Bind Data Item to the Case Step Parameter
-
Edit the test case step which you want to use CSV data.
-
Choose the CSV binding variable from the select box value.
-
Click the save button.
Select Rows of Bound Data to Run Test Case
-
Click the Run button on the right of the case name, then you could select the rows to run.
Notes:
If you upload a CSV file suffixed with “_<YOUR BAW SERVER NAME>.csv”, you need not change the bound CSV file from the test case editor page when you run the test case with a different BAW server. The IDA will automatically select the corresponding CSV file to run the test case. If the IDA does not find the corresponding CSV file, it uses the bound CSV file.
For example:
-
The “Create_Position_Request_CSHS/case1” binds a CSV file named “sample_data.csv”.
-
If you want to run the test case with a different BAW server, the only thing you need to do is upload another CSV file suffixed with “_<YOUR BAW SERVER NAME>.csv”. It is very useful if you want to run the project with different Workflow servers in a pipeline. The IDA will select the corresponding CSV file with the Workflow server.
-
You could find <YOUR BAW SERVER NAME> from “Administration -> BAW Configuration”