Data-Driven Testing using Database in Katalon Studio

Reading Time: 4 minutes

Hello Readers,

There are many instances in the life of QA engineers when they need to execute the test cases using real data. What do they generally do? Run the query. Extract the data in CSV or excel and then pass it to the test cases. A long and tedious process. Tada! We have a solution: Katalon Studio. Well, Katalon provides you with an easy way to use the data stored in your database. It will fetch the data for you and pass it to your test cases. You can just create data set easily using a few clicks rather than importing large libraries for database connection.

Before starting with the way to connect the database, let’s have a brief about the Katalon Studio and Data-Driven Testing.

What is Katalon Studio ?

Katalon Studio is an automation tool. It offers both codeless and coded processes to write automated test cases. Katalon supports the Web, API, Mobile and desktop application testing by utilizing its specialized IDE.

What is Data driven Testing ?

DDT or Data-Driven Testing is a testing methodology where the data from the external files is used in the test cases.

How to use data from the Databases in test cases?

Pre Requisites

To use the Database data in your test cases, you just need two things :

  • Katalon Studio installed in the system
  • JDBC driver

How to add JDBC driver for connecting the database?

There are a few settings that you need to add in Katalon Studio before starting with DDT using the database. Here are the steps to add a JDBC driver in Katalon Studio

  • Firstly, Download the jar file for the JDBC driver. You can easily download it on maven repository. Here’s the link for MySql connector –
  • Next, Go to Katalon Studio and open Project Settings . Then, choose Library Management
  • Click Add and select the downloaded jar file
  • Then, click Apply
library management katalon studio

Now, the Katalon Studio is ready to be connected to your database.

How to connect the Database with Katalon Studio?

After adding the JDBC driver, our next step is to connect our database with the Katalon studio. Below are the steps to connect the database.

  • Select Project from the menu bar and click on the Database
  • Enter the user and password to access the database.
  • Enter the connection URL. Below are the connection url format:
    • MySQL : jdbc:mysql://HOST:PORT/DB_NAME
    • SQL Server : jdbc:sqlserver://HOST:PORT;databaseName=DB_NAME
    • PostgreSQL : jdbc:postgresql://HOST:PORT/DB_NAME?currentSchema=SCHEMA
  • Click Apply and Close
database settings in katalon studio

How to create the Data File

  • Create a new Data Set and choose Data Type as Database Data.
  • A window will appear which will have the information about your Data file. Initially, it will be empty.
data file window
  • Click edit query. A Database Connection and Query Settings window will appear. You can create a new database connection or can use the global one. I have used the global connection here. Enter the query to fetch the data from the database.
data connection and query setting
  • And your Data set is ready to be used in the test cases.
data set

How to use the data set in a test case for data driven testing ?

After creating the data set, we proceed to bind our data set with the test cases. While the execution of the test suite, our test cases will be iterating against the available test data.

  • Create a Test Suite.
  • Then, add your test case in the suite.
  • Click on the Show Data Binding. Here, you will see the the variable used in your test case under variable binding.
test suite
  • Next, change the Type of the variables to the Data Column. Then, select the created Data Set under the Test Data and column_name in the table under the Value.
data driven testing
  • In the end, run the test suite to execute test cases.

We will observe how our test cases passed or failed against each data column. In the end, we will obtain the result of all the iteration combined in one report available under the Report directory.


Unlike other tools where classes are imported for database testing and data-driven testing, Katalon Studio has a codeless way that makes it a handy tool for database testing and data-driven testing. Apart from the database, it also provides support to CSV and Excel files for performing DDT.

Written by 

Gargi Sanadhya is a QA consultant with an experience more than a year in manual and automated testing. She is familiar with the core concepts of manual testing and automated testing using Selenium and Katalon Studio. She is always eager to acquire new tech skills and learn new & advanced concepts to advance herself. She likes to read books, watch web series and know more about space and technology.