Skip to main content

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

Written by Ines

Download files

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.


File Extraction

You can extract data from downloaded files with various extensions such as PDFs, Excel files, CSVs, and more, and store it inside a variable you can reference in later steps.

To do so:

  1. Download a file as explained in the download section above, or use an existing Test Asset.

  2. Create an AI step with a wording like:

  • “Extract YOUR DATA from the file [YOUR_FILE] in [YOUR_VARIABLE]


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?