To Integrating Test Data Generator with Katalon Studio is straightforward and can be achieved in a few simple steps:
Install the Katalon Test Data Generator Plugin from Katalon Store.
OR
Alternatively, download this plugin offline from ChangeLog.
Test Data Generator Keywords
The Test Data Generator Plugin provides two primary keywords to help you efficiently manage your test data.
Generating a Random Value
To generate a random value, use the following keyword:
CustomKeywords.'com.katalon.data.Generator.getRandomValue'(String sampleTestData)
Exp:
CustomKeywords.'com.katalon.data.Generator.getRandomValue'('Password@{123456}')
Saving a Random Value to an InternalData File
To save the generated random value into an InternalData File(User need to prepare Internal Data File with Columns), use the following keyword:
CustomKeywords.'com.katalon.data.Generator.updateDataFile'(String dataFilePath, columsValues)
Exp:
CustomKeywords.'com.katalon.data.Generator.updateDataFile'('Data Files/LoginTestData', username + " " + password)
Below are some examples that demonstrate how to generate different types of random values:
Full Name:
fullName = CustomKeywords.'com.katalon.data.Generator.getRandomValue'('Mohit{123}')
Output: Mohit432
Note: Anything within {} is generated randomly.
Phone Number:
phone = CustomKeywords.'com.katalon.data.Generator.getRandomValue'('94{56823512}')
Output: 9470294386 (94 followed by an eight-digit random number)
Start Date:
startDate = CustomKeywords.'com.katalon.data.Generator.getRandomValue'('2025/{1::6}/{1::15}')
Output: 2025/5/5
Note: {1::6} generates a random number between 1-6.
End Date:
endDate = CustomKeywords.'com.katalon.data.Generator.getRandomValue'('2025-{6::12}-{16::31}')
Output: 2025-11-25
Date and Time:
dateTime = CustomKeywords.'com.katalon.data.Generator.getRandomValue'('202405{1::30}:{1::12}{1::30}33')
Output: 20240528:62820
Email Address:
email = CustomKeywords.'com.katalon.data.Generator.getRandomValue'('{Mohit}{123}@gmail.com')
Output: Omoho718@gmail.com
Custom String:
custom = CustomKeywords.'com.katalon.data.Generator.getRandomValue'('{Mohit}{123}IRE{20345}STR-{1230}{MT}01STR{2025}')
Output: Toiio315IRE69027STR-7185MM01STR8107
These examples demonstrate how to use the Test Data Generator Plugin to create a variety of random values for your test data. The syntax within the curly braces {} allows you to define patterns for generating random characters, numbers, or sequences.
Visit Katalon Forum for Plugin related discussions.