Manage test data
Katalon Studio allows you to use data from multiple sources to run data-driven tests:
- External data: Import Excel and CSV files, or connect to database servers.
- Internal data: Enter data manually in Katalon Studio. You can choose the number of columns and rows and enter a value for each cell.
This document shows you how to create test data files with external and internal data in Katalon Studio.
Create an Excel data file​
To create an Excel test data file, follow these steps:
-
Select File > New > Test Data from the main menu.
-
In the New Test Data dialog, enter a name for your test data and select Excel File as the Data Type. Click OK.
-
Browse to the Excel file that you want to import into Katalon Studio.
-
Data from the selected Excel file is loaded into the preview section below. You can choose the sheet you want to use.
noteBy default, Katalon Studio converts variables to strings to perform data binding. You can disable Bind to test case as string to configure variable binding to read test data values as their intended data types.
-
Save the Test Data when you finish.
You have successfully created an Excel data file. This data file can be used in other configurations. For example, you can use it to input data for test execution when setting up test suites. See Manage data binding.
Create a CSV data file​
To create a CSV test data file, follow these steps:
-
Select File > New > Test Data from the main menu.
-
In the New Test Data dialog, enter a name for your test data and select CSV File as the Data Type. Click OK.
-
Browse to the CSV file that you want to import into Katalon Studio.
-
Data from the selected CSV file is loaded into the preview section below.
-
Save the Test Data when you finish.
You have successfully created a CSV data file. This data file can be used in other configurations. For example, you can use it to input data for test execution when setting up test suites. See Manage data binding.
Create a Database data file​
- You have already set up your database. For more details, refer to Set up database connection.
- Your database is running.
To create a database data file, follow these steps:
-
Select File > New > Test Data from the main menu.
-
In the New Test Data dialog, enter a name for your test data and select Database Data as the Data Type. Click OK.
-
Click Edit Query to open the Database Connection and Query Settings dialog.
-
Enter the connection details and the data query. Click Test Connection to verify whether your database is connected successfully.
In the JDBC Driver field, you can enter the ClassDriverName of the database with a library support connection (JDBC) to query data from additional database sources.
noteYou can check Use global database connection settings to use the connection defined in project settings. See Database Settings.
-
Click OK. The queried data is fetched and loaded into the preview section below.
noteBy default, Katalon Studio converts variables to strings to perform data binding. You can disable Bind to test case as string to configure variable binding to read test data values as their intended data types.
-
Save the Test Data when you finish.
You have successfully created a Database data file. This data file can be used in other configurations. For example, you can use it to input data for test execution when setting up test suites. See Manage data binding.
Create an Internal data file​
To create an internal test data file, follow these steps:
-
Select File > New > Test Data from the main menu.
-
In the New Test Data dialog, enter a name for your test data and select Internal Data as the Data Type. Click OK.
-
In the Editor View, select the option to add a new column.
-
Select the option to add a new row.
-
Click each cell to input its value.
-
Right-click to access the context menu to edit or delete columns or rows.
-
Save the Test Data when you finish.
You have successfully created an internal data file. This data file can be used in other configurations. For example, you can use it to input data for test execution when setting up test suites. See Manage data binding.