Randomized test data is essential for robust and dynamic test automation. Katalon Studio makes it easy with the Data Builder Plugin. Here's how you can use it effectively:
Use Case 1: Prepare Test Data for Data-Driven Testing
Step 1: Install the Katalon Test Data Builder Plugin
- Download the plugin from the Katalon Store.
- Alternatively, download it offline from the plugin's ChangeLog
Step 2: Open the Data Builder UI
- Click the DataBuilder icon in Katalon Studio to access the interface.
Step 3: Enter Required Details
- Fill in fields like:
- File Name
- Variable Name
- Count (number of rows of data to generate)
Step 4: Create the Table
- Click Create Table and define:
- Headers
- Sample Values (Refer to "Sample Data Format" for guidance)
Step 5: Generate Data
- Click Generate Data to populate your Katalon Data file with randomized values.
Step 6: Use the Generated Data
- The generated test data is now ready to bind with variables for data-driven testing.
- Examples: Generating Different Random Data
Input Format | Output Example | Notes
- Full Name: Mohit{123} | Mohit432 | Values within {} are generated randomly.
- Phone Number: +94{56823512} | 9470294386 | Generates an 8-digit number after +94.
- Start Date: 2025/{1::6}/{1::15} | 2025/5/5 | {1::6} generates a number between 1 and 6.
- End Date: 2025-{6::12}-{16::31} | 2025-11-25 | Generates random months and days within ranges.
- Date & Time: 202405{1::30}:{1::12}{1::30}33 | 20240528:62820 | Randomizes the date and time format.
- Email Address: {Mohit}{123}@gmail.com | Omoho718@gmail.com | Combines random letters and numbers.
- Custom String: {Mohit}{123}IRE{20345}STR-{1230}{MT}01STR{2025} | Toiio315IRE69027STR-7185MM01STR8107 | Custom patterns for any data requirement.
Use Case 2: Generate Random Test Data Directly in Test Cases
- Download version 1.0.0 ONLY of the plugin from the ChangeLog
- Add the downloaded file to the Plugins folder in your Katalon Studio project and Reload the Plugin.
- Call the getRandomValue method in your test case and save the output to a variable:
- def randomEmail = CustomKeywords.'com.katalon.plugin.databuilder.getRandomValue'('{Mohit}{123}@gmail.com')
- Use the generated variable as input for other Katalon keywords:
- WebUI.setText(findTestObject('Object Repository/Input_Email'), randomEmail)
Why Use the Data Builder Plugin?
- Easily generate dynamic and custom patterns for test data.
- Simplifies data-driven testing by automating data creation.
- Supports a flexible {} syntax to randomize values within specified ranges.
- Leverage this plugin to enhance your test automation workflow!
Visit Katalon Forum for Plugin related discussions.