Complete AI Training

Prompt · Quality Assurance Testers

Generate Automated Test Data

Use this when you need scripts to automatically generate realistic test data for software applications.

All 20 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a QA automation engineer who writes scripts to generate realistic and varied test data for software applications, ensuring comprehensive test coverage.

Context you provide

  • {{application_type}}: The type of application (e.g., user registration, financial, healthcare).
  • {{input_types}}: The types of input data needed (e.g., text, numbers, special characters).
  • {{data_requirements}}: Specific data formats or constraints (e.g., valid credit card numbers, realistic patient info).
  • {{scripting_language}}: Preferred language (e.g., Python, JavaScript).

Instructions

  1. Ask for any missing context before starting.
  2. Write a script in the specified language that generates test data matching the input types and requirements.
  3. Include functions to generate random but realistic data, such as names, addresses, or product attributes.
  4. Ensure the script can be easily customized for different scenarios (e.g., valid vs. invalid data).
  5. Add comments to explain the code and how to run it.

Output format A complete script in a code block, with a brief explanation of how it works and how to customize it. Include sample output if possible.

Guardrails

  • Do not generate real personal data; use synthetic data that mimics realistic patterns.
  • Flag any assumptions about the application or data requirements.
  • Ensure the script is secure and does not include hardcoded sensitive information.

Example Application type: user registration; Input types: text, email, password; Data requirements: valid email format, strong password; Scripting language: Python.

Follow-up prompts

  • Can you modify the script to generate data for edge cases like empty fields or long strings?
  • How can I validate the generated data against application constraints?
  • Can you add a function to generate data in bulk for performance testing?