Skip to main content

Combine Multiple Data Sources in Katalon Studio

This article shows you how to execute your automation test using predefined test data from multiple sources.

Requirements

  • You need an active Katalon Studio Enterprise license. To learn more about activating licenses, you can refer to this document: Activate Katalon license.

Expand the data binding section in Katalon Studio

To expand the Data Binding section, go to your test suite, click Show Data Binding. This feature help you bind the predefined test data files and manage variable binding with the Test Suite you want to run.

In the extended Data Binding section, there are two tables:

  • Test Data: Specify here the data files for your test execution.
  • Variable Binding: This displays all variables of the selected test case. See also Test case Variables.

Test data table in Katalon Studio

Adding data sources in Katalon Studio

  1. In the Test Data table, click Add to add data file(s). A Test Data Browser dialog opens.

  2. Select a combination of data files you wish to use for variable binding in the Test Data Browser dialog. Click OK.

    The selected test data files appear in the Test Data table.

Modify data range in Katalon Studio

To specify the data range, double-click on the cell under the Data Iteration column of each data files.

OptionDescription
Run all rowsTo use all the data rows in the data file in the test execution.
Run from row ... to row ...To use the data range from a particular row to another particular row in the data file during the test execution.
Run with specific rows

To use the specific data rows in the data file during test execution. You can use comma and hyphen characters to define the rows.

For example:

  • to use three data rows (row 1, row 2, row 3), enter: 1,2,3
  • to use six data rows (row 1, row 2, row 3, row 4, row 5, row 9), enter: 1-5,9

Manage test data relationship in Katalon Studio

To toggle between One and Many, click on the cell under the Type column of each data files. These types represent the relationship of multiple test data sources.

You can also further define the relationship among them as below:

Relationship TypeDescription
OneTo indicate the data set as 'One' in the relationship with the other data set.
ManyTo indicate the data set as 'Many' in the relationship with the other data set.

Therefore, we have the following combinations of data sets:

RelationshipExample
One to One

Given there are two data sets as below:



Then the final data set used for test execution will be:

  • John Marketing
  • Joe Sales
Many to Many

Given there are two data sets as below:



Then the final data set used for test execution will be:

  • John Marketing
  • John Sales
  • Joe Marketing
  • Joe Sales
  • Mary Marketing
  • Mary Sales
One to Many

Given there are two data sets as below:



Then the final data set used for test execution will be:

  • John Marketing
  • Joe Marketing
  • Mary Marketing
  • Emily Marketing
  • John Sales
  • Joe Sales
  • Mary Sales
  • Emily Sales
One to One to Many

Given there are three data sets as below:



Then the final data set used for test execution will be:

  • John Marketing Executive
  • John Marketing Director
  • Joe Sales Executive
  • Joe Sales Director

Variable binding table in Katalon Studio

After adding the test case into the test suite, Katalon Studio automatically imports all variables of the selected test case into the Variable Binding table.

  1. Katalon Studio allows you to Set Type for variables all at once if the variables have the same type. In this case, Username and Password have the same type as Data Column. Highlight both rows, click Set Type > Data Column.

    Set Data Type

  2. In the Test Data column, click on each row to choose the test data files for execution.

    Choose Test data for Data Type

  3. In the Value column, click on each row to specify the data field in the selected data file.

    Choose Value for Data Type

  4. Save the test suite when you finish.

    Final result

    During execution, the username variable looks for the Username column of the valid-accounts excel file while the password variable searches for the Password column of the valid-accounts CSV file.

Bind to scripting value in Katalon Studio

This option allows you to associate the variables with other scripting values.

  1. Highlight rows No. 1 and No.2 > click Set Type > select Script Variable.

  2. Specify the data used in the Value cell.