Skip to main content

Data-driven testing at test case level

Last updated: November 2026

Data-driven testing runs the same test case with different sets of values. At the test case level, you define variables in the test case and bind them to columns in a test data file. The binding stays with that test case, so it can use the same data when run on its own or in different test suites.

For example, a test case might use employee and department variables. If its data file has three rows, Katalon Studio runs the test case once for each row, using that row's values.

Requirements

Starting with Katalon Studio 11.7.0, data-driven test execution requires a paid plan. See pricing page.

Choose where to bind test data​

Test case levelTest suite level
Where you configure the bindingIn the test case's Data Binding tabIn the test suite's Show Data Binding section
When to use itThe test case should carry the same data and variable mapping wherever it runsA suite needs to supply data or mappings for a test case
When the test case is added to another suiteIts binding remains availableConfigure binding for that suite test case

In a test suite, select Use Variables and Binding at Test Case for a test case that should use its own binding. To configure binding in the suite instead, see Data-driven testing in a test suite.

What you need​

  • A test case that uses variables in place of values that change between runs.
  • A test data file containing those values. Katalon Studio supports internal and external data sources. If your data comes from a database, configure the database connection first.
  • A mapping between each test case variable and the appropriate data column. Matching variable and column names let you use Map All.

The following example uses employee and department as test case variables:

Employee and department variables in the test case Variables tab

Set up the binding manually​

  1. Create or import a test data file from File > New > Test Data. Give its columns names that make their purpose clear.
  2. Create a test case that uses variables for the values supplied by the data file. Define those variables in the test case's Variables tab.
  3. Open the test case's Data Binding tab. In Test Data, click Add and select the data file.
  4. In Variable Binding, set each variable's type to Data Column, then choose its test data file and column in Test Data and Value. If the variable names match the column headers, click Map All to map them together.
  5. Save and run the test case. Check the Log Viewer for the result of each iteration.

The Test Data and Variable Binding tables show the file and column selected for each variable:

Test data and variable bindings for employee and department

For more about the available binding controls and data source relationships, see Manage data binding.

Use Katalon AI Assistant​

Katalon AI Assistant can help generate a test script that creates CSV data and a test case script that uses variables. The Katalon AI Assistant sample project demonstrates both prompts and the resulting scripts.

The flow is:

  1. In Script view, prompt AI Assistant to generate a script that creates a CSV file with the test rows. Select the prompt and use Katalon AI Assistant > Generate Code. Review and run the generated script to create the file.
  2. Prompt AI Assistant to generate a test case script that uses variables for the values that change between rows. Review the generated code and define or check those variables in the test case's Variables tab.
  3. Create a CSV File test data item in Studio and select the generated CSV file.
  4. Add the CSV data item in the test case's Data Binding tab and map its columns to the variables.
  5. Run the test case and check each iteration's result.

AI Assistant generates code for this example; you still register the CSV as test data and configure the binding in Studio. The same test case-level binding principles apply whether you write the script yourself or use generated code.

Run the test case in a test suite​

Add the test case to a test suite, click Show Data Binding, select the test case, and choose Use Variables and Binding at Test Case. The suite then uses the binding configured in the test case. While this option is selected, you cannot configure suite-level binding for that suite test case. Switching to this option does not delete any existing suite-level data configuration.

Show Data Binding in a test suite containing a test case with its own binding

After the suite runs, open Reports in Tests Explorer or the project's Reports folder. The report counts each data iteration as an executed test case. See View test suite reports for report formats and details.

Other behavior to know​

  • Multiple data files: By default, multiple data sources at the test case level have a one-to-one relationship. See Manage test data relationships for other options.
  • Called test cases: A called test case does not automatically inherit the caller's variable values or data binding. Define the variables it needs and pass their values in the Call Test Case step. See Call test case.
Was this page helpful?