Generate test data using Zia in Zoho QEngine | Zoho QEngine Help

Generate test data using Zia

In a nutshell
The Generate Data task removes the need to manage and update static test datasets by letting you describe the data you need and generate it on demand. Using Zia, QEngine's AI assistant, you can create realistic, structured sample data directly during test execution, using a plain-text prompt, a reference file, or both.
Availability
  1. Super admins, admins, managers, and testers can use the Generate Data task.

1. Overview

The Generate Data task is a test data generation utility that helps you create realistic, structured sample data during test execution. Instead of maintaining static datasets that go stale, you describe the data you need, and Zia generates it for you on demand, using simple, scenario-based prompts.

This capability is powered by Zia, QEngine's AI assistant, which uses the AI model configured for your portal under Setup. Based on your configuration, Zia can leverage Zoho GenAI, OpenAI, Google Gemini, or Anthropic to generate contextually relevant data. The task behavior and output format remain consistent regardless of which provider is active.

You can use this task to produce structured inputs such as form fields, grouped test data, or scenario-specific datasets. For example, data for a registration form, an employee onboarding workflow, or a multi-step checkout flow, enabling more meaningful and realistic test coverage.

How it works
You write a prompt based on the test case you are building, describing the fields, values, or constraints your scenario requires. Zia uses this to generate data that fits your test context directly.

You can provide this input as:
  1. A plain-text prompt describing the data you need. For example, Generate form fields for a student picnic registration”. 
  2. A reference file (JPG, JPEG, PNG, or PDF, up to 3 MB), such as a screenshot or document that Zia uses to infer the required fields and generate matching values. You can also pair a file with a prompt to specify additional constraints or formatting rules. 
Zia processes your input and returns a JSON-formatted string containing the generated data. You store this output in a variable and reference it in subsequent test steps to populate form fields, simulate user inputs, or drive complex test scenarios without relying on external data files.

The Generate Data task works across Web, Android, and iOS platforms, so you can use the same syntax and expect the same output behavior regardless of the application environment you are testing.

Prerequisite

The Generate Data task requires Zia to be connected to an AI model under Setup. Without a configured provider, the task cannot generate data. Learn how to configure an AI model for Zia

2. Syntax

zia.generateData(<prompt>); 
or
zia.generateData(<filename>,<prompt>);

Parameters
Description
<prompt>
A natural language instruction describing the sample data you want Zia to generate. Optionally, when used with a file, the prompt acts as a directive, telling Zia how to interpret the file or what to extract from it.

NotesNote: The maximum length the prompt can have is 3000 characters.
<filename>
A reference to a file uploaded in your project's Files settings, used by Zia to model the generated data. 

Referenced using the built-in files namespace as files.<user_defined_name>, where <user_defined_name> is the name you assigned when uploading the file. 

Notes
Note: The supported formats for the file are jpg, jpeg, png, and pdf. And, their file size must be under 3 MB. 

Notes
Security Tip:  Avoid including personally identifiable information (PII) or confidential details in any content you upload, as it will be processed by the underlying language model. If you are using Zoho's GenAI model, your data will remain within your organization and will not be used for any external purposes.

Return Value
 
Type 
Description
String
A JSON-formatted string containing the generated sample data. The output structure reflects the fields and context described in your prompt or inferred from the uploaded file. This output structure is consistent regardless of which AI model is configured for your portal.

3. Use case

An HR application has an employee registration form with two date fields: date of birth and date of joining. The form enforces that the date of joining must always fall after the date of birth. Testing this validation requires multiple employee records with realistic, correctly ordered dates.

Using the Generate Data task with a plain-text prompt, you can describe the data requirements, including the date ordering constraint. Zia generates a set of realistic employee records satisfying this rule. The output is stored in a variable and used to populate form fields in subsequent test steps.

  1. // Generate employee records with valid DOB and DOJ pairs
  2. employeeData = zia.generateData("Generate 5 employee records. Each record must include a full name, date of birth, and date of joining. The date of joining must always be after the date of birth. Format: Name, DOB (YYYY-MM-DD), DOJ (YYYY-MM-DD).");
  3. info(employeeData);

  4. // Store the generated data to use across test steps
  5. testData = employeeData;

4. Points to note

  1. Each prompt can contain up to 3000 characters
  2. The Generate Data task accepts file in the following formats:  jpg, jpeg, png, and pdf.
  3. Each file passed to the task must not exceed 3 MB.
  4. Each call to the task accepts only one file.
  5. The task will time out if Zia does not return a response within 60 seconds.
  6. When you use Zoho GenAI as the configured AI model, the Generate Data task is subject to throttling with a limit of 50 requests per user per minute. If this threshold is exceeded, subsequent requests will be delayed or temporarily restricted until usage falls back within the allowed limit. For other providers (OpenAI, Google Gemini, Anthropic), throttling is governed by the respective provider's own rate limits