Combine multiple data sources

Estimated reading time: 4 minutes

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

In the test suite editor, click Show Data Binding to add predefined test data files and manage variable binding for your test case execution.

Katalon Studio expands the Data Binding section with Test Data and Variable Binding tables.

  • Test Data: You can specify data files used for data binding.
  • Variable Binding: If there's any public variable defined in your test case, you can manage variable binding by specifying which value would be used for which variables during test execution.

Test Data

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

  2. In Test Data Browser, select a combination of data files you prefer to use for variable binding. The selected test data files are added to the table accordingly.

  3. Double-click on the Data Iteration to specify the data range to be used for execution.

    Where:

    OptionDescription
    Run all rowsAll the data rows in the data file will be used during test execution.
    Run from row ... to row ...The data range from a particular row to another particular row in the data file will be used during test execution.
    Run with specific rows

    The data rows which are specified here will be used 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
  4. Click Type to toggle between One and Many, which represents the test data relationship of multiple test data sources.

Manage test data relationship

If you are specifying multiple test data, you can further define the relationship among them to decide how the final data set used in the test execution will be. There are two types of relationship supported in Katalon Studio:

Relationship Type Description
One The data set will be indicated as 'One' in the relationship with other data set.
Many The data set will be indicated as 'Many' in the relationship with 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

In the Variable Binding table, all the public variables defined in that test case are displayed for being bound to the configured test data.

  1. Katalon Studio allows users 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 and select Data Column:

  2. Click on each cell of the Test Data column to decide which test data from the list to be passed into this variable during execution.

  3. Click on each cell of the Value column to specify the data field to be used during execution. Select one of the headers of the selected test data; the selected header will be specified accordingly.

  4. Save the test suite when you're done.

    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

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

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

  2. Specify the data to be used in the Value cell. This value is used during execution.

User Contributed Notes