Skip to main content

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.

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
Note:

Katalon Studio supports Groovy from version 2.4.x onwards.

Groovy variables are the variables defined in 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.

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:

Data-driven testing methods

Katalon Studio supports the following data-driven testing methods:

Alternatively, you can also perform data-driven testing with Groovy using the findTestData method. To learn about this method, you can refer to our API documentation: TestData.

Learn in practice with our free Katalon Academy course: ​ Katalon Studio: How to Apply Data-Driven Testing.