> 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-image.md).

# Generate Image

Generate a JPEG or PNG image at run time for upload or webcam Flows.

Generate image creates a JPEG or PNG during the Run. Use it when the journey needs an image file that does not already exist on the page, such as an upload or a webcam stream.

![Generate image Test Step](https://static.does.qa/assets/nodes/runner_generate_image.png)

## When to use it

* Build an image to upload with [File](https://docs.does.qa/test-steps/action/file.md).
* Feed a webcam check with [Set webcam](https://docs.does.qa/test-steps/runner/set-webcam.md).
* Prefer a fixed Filename so later steps can pick the Generated File reliably.

## Example Flow

Generate the image, then upload it with [File](https://docs.does.qa/test-steps/action/file.md).

![Generate image then File upload](https://2973996442-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FH10EEO19EDpBHNPowThh%2Fuploads%2Fgit-blob-4ee9ef99f692ce044518c9d9df78842551d61c18%2Fgenerate-image-upload-miniflow-approx.png?alt=media)

## Configure

### Basics

| Field           | What to set                                                      |
| --------------- | ---------------------------------------------------------------- |
| **Type**        | `JPEG` (default) or `PNG`                                        |
| **Filename**    | Text and/or [Values](https://docs.does.qa/values/value-store.md) |
| **Custom text** | Optional text drawn into the generated image                     |
| **Width**       | `1`–`2000` (default `600`)                                       |
| **Height**      | `1`–`2000` (default `400`)                                       |

### Advanced

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

{% hint style="info" %}
**Pro tip:** Keep Width and Height close to what the upload field expects so the app accepts the file on the first try.
{% endhint %}

## Related

* [File](https://docs.does.qa/test-steps/action/file.md)
* [Set webcam](https://docs.does.qa/test-steps/runner/set-webcam.md)
* [Generate file](https://docs.does.qa/test-steps/runner/generate-file.md)
* [Test file uploads and downloads](https://docs.does.qa/guides/test-file-uploads-and-downloads.md)
* [Runner](https://docs.does.qa/test-steps/runner.md)

**Tags:** `runner`, `generate`, `image`
