Skip to main content

How to Upload / Download and assert on Files within a test case

Ines avatar
Written by Ines
Updated over a week ago

This doc explains how to download and upload files during a Test Case run.

Download files

Browser compatibility: This feature is currently stable only on Firefox. You may face issues with Chromium-based browsers.

You can download files by creating an AI step with a wording like:

  • “Click button X to download the file”

  • “Download file.txt”

Reference downloaded files in later steps

Once a file is downloaded, you can reference it later in your Test Case using:

  • [DOWNLOADED_FILE_1] for the first downloaded file

  • [DOWNLOADED_FILE_2] for the second downloaded file

  • and so on

Assert on downloaded files

You can write assertions on downloaded files, such as:

  • Asserting on the file type (example: .txt, .pdf, etc.)

  • Asserting on the file size (in bytes)

  • Asserting on the file content

For more details, see File Assertions in How to Assert?.

Download the file locally (to inspect it)

You can download the downloaded file and inspect it by clicking the cloud download icon in the run.


Upload files

You can upload a file by creating an AI step with a wording like:

  • “Upload [DOWNLOAD_FILE_N]

  • “Upload [TEST_ASSET_NAME]

What you can upload

The file you upload can be one of two types:

  1. A downloaded file

    • Example: upload [DOWNLOADED_FILE_1] (as explained in the Download section above).

  2. A Test Asset

Did this answer your question?