Skip to main content
Use these recipes to upload and download files, select dropdown options, and capture network requests in web tests.

Upload files

Upload a file in a web test with the File upload step, from a remote URL, a previously downloaded file, or a local path.
The File upload step must come before the step that opens the native file picker.

Setup

  1. Add a File upload step with a source:
    • Remote URL: http://... or https://... (publicly accessible)
    • Previously downloaded file: file://<download-key> from an earlier download step
    • Local file: absolute path accessible to the local CLI process
  2. (Optional) Set a Filename to rename the uploaded file.
  3. Add a Click step on the button that opens the file picker.

Limits

  • One file per step.
  • Files fetched from remote URLs are limited to 50MiB.

Download files

Capture a file your app downloads when a step clicks a button or link, and optionally save its URL to reuse later in the test (for example, to feed into an upload step).

Setup

  1. Add a Click step on the button/link that triggers the download.
  2. Enable Wait for download on that step.
  3. (Optional) Set Save to environment variable to capture the file URL (e.g. DOWNLOADED_FILE). The saved object contains downloadedFile, a complete file:// URI. Pass {{ env.DOWNLOADED_FILE.downloadedFile }} to a later upload step.

Limits

  • One file per Click step.
  • Download timeout: 30 seconds by default. Set click.downloadTimeout in milliseconds to change it.
  • Downloaded files are temporary and are deleted five minutes after capture.
  • Direct file manipulation (reading contents, checking format) is not supported.

Select options from a dropdown

Pick an option from a dropdown during a test. The approach depends on whether the element is a native <select> or a custom menu.
Inspect the element first to confirm whether it’s a native <select> or a custom menu (e.g. Headless UI, Radix, shadcn). The approach differs.

Native <select>

  1. Add a Select step and describe the element (e.g. “The country select”).
  2. Click Find using description to populate the options list.
  3. Choose an option by label, value, or index.

Custom dropdowns

For React/Vue component libraries (Headless UI, Radix, Material UI, shadcn, etc.), use two Click steps:
  1. Click on the dropdown trigger (e.g. “The country dropdown”).
  2. Click on the desired option (e.g. “USA inside the country dropdown”).

Record and validate network requests

Use network steps to verify your UI sends the right data to the backend, or that the backend returns what you expect.

Wait for a single request

  1. Add a Register request listener step: provide a URL regex and a key (e.g. CHECKOUT_REQUEST).
  2. Trigger the request (submit a form, click a button, etc.).
  3. Add an Await listener step with the same key. Save the result to an environment variable (e.g. RESPONSE). The step fails if no matching request completes within the timeout.
  4. Add a JavaScript step to validate:

Record multiple requests

  1. Add a Record requests step: provide a URL regex and a key (e.g. ANALYTICS_EVENTS).
  2. Trigger the requests (navigate, click, fill forms, etc.).
  3. Add a Get recorded requests step with the same key. Save the array to an environment variable (e.g. REQUESTS).
  4. Validate in a JavaScript step:
Requests that didn’t complete before Get recorded requests ran are still included in the array, without a response field.