Katalon Studio Data Driven Testing with Excel

Data Driven Testing (DDT) is the practice of using test data held in a table or form in automated testing. In Data Driven Testing, the expected results can also be used alongside the test data for comparison. Data Driven Testing is also known as Table Driven Testing or Parameterized Testing. Katalon Studio supports Data Driven Testing with Excel.

Katalon Studio has a structure that allows test data to be used on a scenario or test suite basis. Katalon Studio allows data to be used from either an internal structure or an external structure. Excel, CSV, internal files, and databases can be used as external structures.

Manage Your Test Data with Katalon Studio Excel

We have mentioned that Katalon Studio can use external and internal test data sources for Data Driven Testing. External data can be used via Excel, CSV, and Database, while internal data can be inputted manually on Katalon Studio. Let's briefly examine how to use data via Excel.

Creating a Test Data File with Excel Step by Step

To create a data file with Excel, select File > New > Test Data. You can also access this screen by going to Data Files > New > Test Data on the Test Explorer screen.

After giving the data file a suitable name, select Excel as the Data Type.

The Excel file where the test data is stored will be uploaded to Katalon Studio by selecting the "Browse" step on the File name section.

We have prepared our test data file as shown below. Then we select our file from its location by clicking the "Browse" button shown in the above image.

After selecting our file, it will recognize all the data in Excel as shown below.

After completing the editing process, you can save your test data by clicking the save button.

Implementing Data Driven Testing at the Test Case Level

First, create a new test case and add two new variables named "NAME" and "GENDER" from the "Variables" tab.

Next, go to the "Script" tab and print the variables using Groovy or Java.

We printed the created constant variables. Now we will go to the "Data Binding" menu from the sub-tab to print the values from the Excel file we added as test data. The Data Binding menu will welcome us with a screen as shown below. We will select the test data we uploaded from the top menu. Then we will match the binding variables from the bottom section. To put it more simply, we will determine which variables to use.

First, click the "Add" button to add the Test Data from the top menu.

You may have added more than one test data. Select the test data you want to use. If you have defined the headings correctly, the "Map All" button on the top menu will match the variables with the test data.

Only one of the two variables we created matched, and it was automatically added to the "Variable Binding" menu.

We will manually add the other variable. First, select Type > Data Column sequentially.

We will select the test data we want to use. As Value, we will select the column we want to use. After completing all these steps, the screen will look like the one below.

In this way, you can use Excel as an external structure in Katalon Studio for Data Driven Testing.

You can contact us to meet the Katalon Studio automation tool and to talk about the test solutions we provide for your applications.

Click here
to read our article on The Relationship Between Software Quality and Testing.