Test Data

This tool allows the creation of test data files based on a template structure (XML or JSON) and configurable generation rules.

Test Data Generation

Workflow Overview

  1. Select Template: Choose a loaded file (from the Select Template File dropdown) to use as the structural template for generation.
  2. Configure Fields: Define how data should be generated for each field within the template structure.
  3. (Optional) Save Configuration: Save the current field configurations for later reuse.
  4. Set Generation Options: Specify the number of files to generate and optionally choose a source ZIP template.
  5. Generate: Create the test files based on the template and configurations.

Features

Template Selection

Lists Management

Template Configuration

This interactive tree displays the structure of the selected template file and allows configuration of data generation for each field.

Field Generation Behaviors

Custom Scripts

Custom scripts are JavaScript expressions that generate dynamic values. They have access to:

Script Behavior

Example Use Cases

1. Formatting IDs with Specific Patterns
// Generate IDs like "TD0000001", "TD0000002", etc.
// In this example, we don't use the "value" parameter
const prefix = "TD";
const baseNumber = 2; // Starting number
const digits = 7;     // Number of digits in the numeric part

// Calculate the current number based on file index
const currentNumber = baseNumber + index;

// Format with correct number of leading zeros
const formattedNumber = currentNumber.toString().padStart(digits, "0");

// Combine prefix and formatted number
return `${prefix}${formattedNumber}`;
// For index = 0 → Returns: "TD0000002"
2. Formatting and Combining Values
// Format a phone number (ignoring the original "value")
const num = Math.floor(1000000000 + Math.random() * 9000000000);
return `(${num.toString().substring(0,3)}) ${num.toString().substring(3,6)}-${num.toString().substring(6)}`;
// Returns: "(123) 456-7890" (with random numbers)
3. Date Manipulations
// Generate a date N days from today (YYYY-MM-DD)
const date = new Date();
date.setDate(date.getDate() + index * 7); // Weekly dates
return date.toISOString().split("T")[0];
// For index = 0 → Returns: "2023-07-14" (today's date)
4. Complex Value Generation
// Generate GUIDs with a consistent pattern
return `${index}-${Math.random().toString(36).substring(2, 10)}-${Math.random().toString(36).substring(2, 6)}`;
// For index = 0 → Returns: "0-a1b2c3d4-e5f6"
5. Conditional Logic
// This example USES the "value" parameter
// Assuming "value" contains an age string like "25"
const age = parseInt(value || "0");
if (age >= 65) return "Senior";
if (age >= 18) return "Adult";
return "Minor";
// For value = "15" → Returns: "Minor"
6. Working with Row Data
// Combine title and author from row data
if (row.title && row.author) {
  return `${row.title} by ${row.author}`;
}
// If row.title = "The Great Gatsby" and row.author = "F. Scott Fitzgerald"
// Returns: "The Great Gatsby by F. Scott Fitzgerald"

Tips

Configuration Management

File Generation Options