> For the complete documentation index, see [llms.txt](https://docs.does.qa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.does.qa/test-steps/runner/generate-file.md).

# Generate File

Generate file creates a file during the Run. Use it when the journey needs content that is not already on the page, such as an upload, an open-in-browser check, or an SFTP transfer.

![Generate file Test Step](https://app.does.qa/screenshots/node/runner_generate_file.png)

## When to use it

* Create a file to upload with [File](/test-steps/action/file.md).
* Create a file to open with [Open file](/test-steps/browser/open-file.md).
* Create a file to send with [SFTP Upload](/test-steps/integration/sftp-upload.md).

## Example Flow

Generate the file, then upload it with [File](/test-steps/action/file.md).

![Generate file then File upload](/files/J2WSUbMfRA9E3lh4oJPX)

## Configure

### Basics

| Field             | What to set                                                                |
| ----------------- | -------------------------------------------------------------------------- |
| **Filename**      | Text and/or [Values](/values/value-store.md)                               |
| **Type**          | `Plain Text` (default), `PDF`, `JSON`, or `Excel (xlsx)`                   |
| **Contents**      | Body text when Type is Plain Text, PDF, or Excel                           |
| **JSON Contents** | JSON body when Type is JSON (Values can sit inside strings as `{{runId}}`) |

### Advanced

| Field                                 | What to set                                          |
| ------------------------------------- | ---------------------------------------------------- |
| **Status on fail**                    | [Failed Status](/test-step-options/failed-status.md) |
| **When should screenshots be taken?** | `Always` or `On Failures` (default)                  |

{% hint style="info" %}
**Pro tip:** Put dynamic parts in Values inside Contents or Filename so one Flow can produce unique files per Test Case.
{% endhint %}

## Related

* [File](/test-steps/action/file.md)
* [Open file](/test-steps/browser/open-file.md)
* [SFTP Upload](/test-steps/integration/sftp-upload.md)
* [Generate image](/test-steps/runner/generate-image.md)
* [Test file uploads and downloads](/guides/test-file-uploads-and-downloads.md)
* [Runner](/test-steps/runner.md)

**Tags:** `runner`, `generate`, `file`
