Data-driven testing with Katalon Studio
Data-driven testing (DDT) is running test scripts with various data sets instead of using hard-coded values. Katalon Studio allows you to perform data-driven testing with internal and external data sources at both test case and test suite levels.
You can download the data-driven testing sample project from our GitHub repository: Shopping cart sample.
This document discusses the DDT components and the supported data-driven testing methods in Katalon Studio.
Starting with Katalon Studio 11.7.0, data-driven test execution requires a paid plan. Free-plan users cannot run data-driven tests, including Test Suite Collections in which any suite uses data binding.
Variables​
Katalon Studio supports three types of variables: global variables, test case variables, and Groovy variables.
Global variables​
Global variables are variables defined in the execution profile and can be used in a test case, test object, web service object, and email configuration within a project. To learn more about global variables, see Global variables.
Test case variables​
Test case variables are variables defined in a test case, allowing you to pass dynamic data into a test case. You can create test case variables and call test cases with variables in both manual and script mode.
To learn more about using test case variables, see Test case variables.
Groovy variables​
Katalon Studio supports Groovy from version 2.4.x onwards.
Groovy variables are the variables defined in a Groovy script. For example:
// x is defined as a variable of String type
String x = "Hello";
// y is defined as a variable of int type
int y = 5;
// The value of the variables are printed to the console
println(x);
println(y);
To learn more about Groovy, refer to this Apache Groovy document: Groovy semantics.
Test data​
Test data is the data created for data-driven testing.
You can create internal or external data files, then configure data binding to read test data values from these files. To learn more about test data in Katalon Studio, see Manage test data.
By default, Katalon Studio converts variables to strings to perform data binding. However, you can disable this function to allow Katalon Studio to read test data values as their data types. See Enhanced variable binding.
For an optional MCP-based way to write test case data bindings in Katalon Studio 11.6.0 and later, see Test Case tools.
Set parameter for your test script​
You can pass variables to your test scripts by setting parameters in test cases, test objects, or their properties:
- Parameterize Web Test Objects
- Parameterize Mobile Test Object
- Parameterize Web Service Object
- Parameterize Windows Test Objects
Data-driven testing methods​
Katalon Studio supports the following data-driven testing methods:
- In a test case: Perform data-driven testing in a test case independently from the test suite. See Data-driven testing at the test case level.
- In a test suite: Perform data-driven testing in a test suite. See Data-driven testing in a test suite.
- In a dynamic test suite: Perform data-driven testing in a dynamic test suite. See Data-driven testing in a dynamic test suite.
To add iteration names to test suite results with Set Test Name, see Specify iteration names in data-driven testing reports.