Document Generation Steps
How to generate TXT, CSV, and Excel files during test execution for file upload, import, export, and document-dependent workflows.
Quick answer
Add a Document step when a test must create a file before uploading or validating it. Choose txt, csv, or excel, provide a file name and output variable, map each field to a static value, variable, expression, or reference, and use the output variable in the later upload step. Choose excel with an .xlsx name for workbook-based import flows.
Document generation steps create files during test runtime with configurable content. Use them when your test needs to upload a file with specific data, verify an import workflow with known values, or test document processing features with controlled inputs.
Prerequisites
You have created or opened a test case.
You are familiar with the Test Steps Editor basics.
Adding a document generation step
Open a test case and click Add Step.
In the step builder sidebar, select Document.
Configure the document type, file name, and data mappings.
Click Create Step to add the step to your test case.
Fields
Document Type
Yes
The file format to generate: txt, csv, or excel (an Excel workbook).
Output Variable
Yes
The variable name that stores the generated file reference. Default: Input.
File Name
Yes
The name of the generated file (e.g., test-data.csv).
TXT-specific fields
Separator
The string used to separate values within the file.
File Format Header
Header content written at the top of the file.
CSV-specific fields
Delimiter
The character used to separate columns: Comma (,), Semicolon (;), Tab, or Pipe (`
Excel-specific behavior
Select excel when the application requires a spreadsheet workbook rather than delimited text. Define the column names and values with the same data-mapping rows used for CSV. Use an .xlsx file name, such as users-import.xlsx, so the generated artifact is easy to identify in later upload steps and run results.
Template source
You can populate the document from a template or define content from scratch:
Create New
Define a new template with a name and description. The template is saved for reuse.
Existing
Select a previously saved template by ID.
Upload
Upload a template file to use as the base.
Data mappings
Each mapping row defines a column or field in the generated file:
Key
The column or field name.
Value Type
How the value is sourced: Variable, Static, Expression, Reference, or Text (legacy alias for Static).
Value
The actual value or variable reference (e.g., ${testEmail} for Variable type, or John Doe for Static type).
Example: Generate a CSV for bulk import testing
Example: Generate a TXT configuration file
Example: Generate an Excel workbook for an import flow
Advanced settings
Skip Step
Skip this step during execution without removing it from the test case.
Mark as Optional
If enabled, a failure on this step does not fail the overall test case.
Tips & best practices
Use Variable value types to make generated documents dynamic. Reference test data profile columns or environment variables so the file content changes per test run.
Save templates for reuse. If multiple test cases need the same file structure with different data, create a template once and select it with the Existing option in subsequent steps.
Reference the output variable in later AI Agent steps to upload the generated file. The variable holds the file reference that the upload step uses.
Match the file format to what your application expects. If the import feature requires semicolon-delimited CSV, set the delimiter to Semicolon. If it validates workbook uploads, choose excel and use an
.xlsxfile name.
Troubleshooting
The uploaded file is rejected by the application Check that the document type, delimiter, and column names match the format your application expects. Generate the file, download it from the execution report artifacts, and inspect its contents.
Variable values are not substituted in the file Verify the variable name syntax (${variableName}) and that the referenced variable is set by an earlier step. Variable names are case-sensitive.
Template not found If using the Existing template option, confirm the template was saved in the same workspace. Templates are scoped to the workspace version.
Related pages
Last updated
Was this helpful?
