Table of contents
1.
Introduction
2.
Expanding the Data Binding Section
3.
Test Data table 
4.
Variable Binding table
4.1.
Bind to scripting value
5.
Data-driven Testing at the test case level in Katalon
6.
Performing Data Binding at the Test case level
6.1.
Creating a new test data
6.2.
Create test case variables
6.3.
Perform Data Binding
7.
Execute/Run test suites with connected test cases
8.
Frequently Asked Questions
8.1.
What exactly is meant by data files in Katalon?
8.2.
What is meant by data-driven testing(DDT)?
8.3.
Does Katalon use WebDriver?
9.
Conclusion
Last Updated: Mar 27, 2024

Combining Multiple Data Sources and Testing at the Test Case Level in Katalon

Author Nagendra
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Hey Ninjas!! Welcome to another article on Katalon. The Katalon platform offers testing solutions. It benefits teams of various sizes and testing maturity levels. The toolkit assists small teams in the early stages of automation. It helps to grow into large international corporations in AI/ML. It also supports sharing of API documents to collaborate with external teams. Katalon also supports API Testing. The API testing tool tests a software on performance and reliability.

Combining Multiple Data Sources and testing at the test case level in Katalon Image

The blog explains the details of Combining Multiple Data Sources and testing at the test case level in Katalon.

Without further ado, let's get started.

Expanding the Data Binding Section

First, we need to expand our Data Binding section. The data binding allows us to wrap up similar data types together. We can do this by going to our test suite, where we can find a feature named Show Data Binding. This assists you in managing variable binding with the test suite you want to run. Test suites in katalon are a collection of test cases.  It also binds the specified test data files. Variable binding allows users to wrap up similar types of variables together. Follow the steps:

  • Click the Show Data Binding option.
     

In this section, we can find two tables- Test Data and Variable Binding

  • The Test Data table contains the specification of the test files used for test execution.
     
  • The Variable Binding table contains all variables of the test case.
Login test suite Image

Credit: docs.katalon.com

Let us individually learn them in detail.

Test Data table 

It contains the specification of the test files used for test execution.

For adding data sources, the Add option is used to add data file(s). 

  • Click the Add button.
     

The Test Data Browser dialog box will appear as shown below.

Test Data Image

Credit: docs.katalon.com

Here, we can select whichever combination of data files we want to use for variable binding. 

  • Select OK.
     

 The Test Data table containing all the test data files will appear. 

Test Data Browser Image

Credit: docs.katalon.com

Here all the data files and folders are displayed.

The Test Data table will look like the following:

Test Data table Image

Credit: docs.katalon.com

Double-click on the Data Iteration column. The Data Iteration column has 3 options:

  • Run all rows: To execute the test using all of the data rows in the data file.
     
  • Run from row .. to row ..: To use the data range in the data file from one specific row to another specific row during the test execution.
     
  • Run with specific rows: To execute tests using particular data rows from the data file. The rows can be defined using commas and hyphen characters.
     

 The Data Iteration column looks like the following:

Data iteration Dialog Box Image

Credit: docs.katalon.com

You can iterate through the rows using the above Dialog Box.

Variable Binding table

Variable Binding table contains all variables of the test case. All the test case's variables are automatically imported into the Variable Binding table.

Follow the following steps:

  • If all the variables have the same type, you can Set Type for them all at once.
     

 Let us consider Password and Username are of the same type as a data column in this instance. 

  • Select Set Type > Data Column while selecting both rows.
Variable Binding Dialog Box image

Credit: docs.katalon.com

  • Click on each row. This will select the test data files for execution.
Test Data Link Browser image

Credit: docs.katalon.com

  • Click on each row in the Value column to choose the data field in the chosen data file.
Variable Binding Column Value Image

Credit: docs.katalon.com

  • Save the corresponding test suite.
Variable Binding Image

    Credit: docs.katalon.com

The results will be saved as shown above.

Bind to scripting value

You can utilize an option known as Bind to scripting value. This will associate the variables with other scripting values. The scripting value refers to the data present in a specific column name.

For instance, we want to highlight row no. 1 and row no. 2.

Follow the steps:

  • Click on the option Set Type. 
     
  • Select Script Variable.
Script Variable Option Image

Credit: docs.katalon.com

You can specify which data to be used in the Value cell as shown below.

Variable Value builder Image

Credit: docs.katalon.com

This will bind your variable to the scripting value.

Data-driven Testing at the test case level in Katalon

Data-driven testing is a technique for testing software. With data-driven testing, testers can enter a test script that can run tests using all test data from a database. They can anticipate the test results to be returned in the same table.

You can add one or more data files and handle data binding using data-driven testing (DDT) at the test case level. It helps you maintain the binding data's independence in the test case.

Using this feature, you can perform the following:

  • Bind each test case to a specific set of information.
     
  • Open a test case and run it using various test data combinations.
     
  • You have the option of performing new data binding in a test suite or reusing data binding at the test case level when running a test suite with linked test cases.

This feature enables you to perform data-driven testing in a dynamic test suite in addition to the data-driven testing techniques we presently support.

Performing Data Binding at the Test case level

Follow the following steps to perform data binding:

Creating a new test data

Select File > New > Test Data to create a new data file. 

Create test case variables

The following steps creates new test case variable:

  • Go to File, click on New and then select Test Case
    Give a specific name to the test case, and a new test case will be created. In the below image, we have named the new test case as DDT at TC level.
DDT Test case level Image

Credit: docs.katalon.com

  • Go to the Variables tab and click on Add to add test case variables. 
Variables Option Image

Credit: docs.katalon.com

  • Select the Data Binding tab. Here, two tables are present: Test Data table, and Variable Binding table.
Data binding option Image

Credit: docs.katalon.com

The above image displays the Test Data table and Variable Binding table.

In step 2, we have added new test case variables in the Variables tab.

Variable Binding Option Image

Credit: docs.katalon.com

The variables added in this step will get automatically added in the Variable Binding section.

Perform Data Binding

The following steps perform data binding at the test case level:

Navigate to the Test Data table and perform following steps:

  • First step is to add data files. Click on Add. The Test Data Browser dialog box will appear.
Test Data Image

Credit: docs.katalon.com

The Test Data Browser window allows you to choose which data files to utilise for variable binding. 

  • Press OK
     
  • In the Test Data table, the chosen test data files are displayed.
Test Data browser Image

Credit: docs.katalon.com

  • Double-click on the cell in each data file's Data Iteration column to specify the data range. 
     
  • Go to the Variable Binding table and perform the following steps:
    • If all of the variables are of the same type, you can Set Type for all of the variables at once. Consider the following example:

Here, the Employee and Department variables are having same type as the Data Column. When both rows are selected, select Set Type and then select Data Column. The data type will be set at once.

Variable Binding data Column Image

Credit: docs.katalon.com

  • Go to the Test Data column.
     
  • Select the test data files for execution by clicking on each row as shown below.
Variable Binding data files Image

Credit: docs.katalon.com

  • When a variable and a data field in a selected data file have the same name, select Map All. It will rapidly map all variables to all data fields. 
Variable Binding Map Image

Credit: docs.katalon.com

Here, this method automatically maps the test data's "Employee" and "Department" columns to the "Employee" and "Department" variables.

  • You can also click on each row to select the data field in the chosen data file in the Value column.
Variable Binding choose column image

Credit: docs.katalon.com

  • Save the test case and execute it. 
     
  • Navigate to the Log Viewer tab to see the test results
Log viewer Image

Credit: docs.katalon.com

The log viewer will display the result as shown above.

Execute/Run test suites with connected test cases

The following steps run test suites with associated test cases:

  • Add the associated test case with a test suite.
     
  • Click on the Show Data Binding option in the test suite editor for performing data binding.
New test Suite Image

Credit: docs.katalon.com
 

  • Choose the level of data binding. 
    At the suite test case (STC) or the test case (TC), you can bind data. By default, the Use Variables and Binding at Suite Test Case option is chosen.
Data Binding Option Image

Credit: docs.katalon.com
 

  • Click on the Run button to execute the test suite.

Frequently Asked Questions

What exactly is meant by data files in Katalon?

Data files are a powerful feature that enables us to easily store and retrieve data from sources.

What is meant by data-driven testing(DDT)?

Data-driven testing (DDT) is data that is loaded and utilized to extend the automated test cases that are not part of the functional tests.

Does Katalon use WebDriver?

Katalon uses the Selenium WebDriver framework.

Conclusion

In this article, we have extensively discussed the details of Combining Multiple Data Sources and testing at the test case level in Katalon Studio.

We hope that the blog has helped you enhance your knowledge regarding Combining Multiple Data Sources and testing at the test case level in Katalon. You can refer to our guided paths on the Coding Ninjas Studio platform to learn more about DSADBMSCompetitive ProgrammingPythonJavaJavaScript, etc. To practice and improve yourself in the interview, you can also check out Top 100 SQL problemsInterview experienceCoding interview questions, and the Ultimate guide path for interviews. Do upvote our blogs to help other ninjas grow. Happy Coding!!

Live masterclass