Adding download assertions

Adding download steps in your mabl trainer

Mabl detects and adds download steps automatically whenever a download completes during a training session.

  1. Start a new test or edit/retrain an existing test.
  2. Trigger the download of interest. (In other words, click on the download link or button).

Upon download completion, mabl will show a new assertion step for your download.


Custom find clicks

A click step that uses custom find will not trigger a download assertion.

Configuring download assertion steps

By default, downloads will assert against the name of the downloaded file. You may add/edit additional assertions by hovering over the download assertion step and clicking the pencil icon that appears.

Additional attributes for a download assertion include the following:

FilenameAssert downloaded file has the give file name (case sensitive), except for auto-numbering
MIME typeAssert downloaded file was sent with the expected headers (case insensitive)
Exact file sizeAssert downloaded file is an exact size in bytes
Minimum file sizeAssert downloaded file is at least a given number of bytes
Maximum file sizeAssert downloaded file is at most at given number of bytes


Download assertion limitations

Mabl does not currently support download assertions for the following:

  • Dynamic file names
  • Partial strings in file names

If either of these assertion types would be helpful for you, consider submitting a feature request in the mabl Product Portal.

Auto-numbering removal

Browsers add numbers to repeatedly downloaded files. For example, will be foo (1).zip when downloaded twice in Google Chrome. The download filename assertion will automatically elide these numbers during assertions so that foo (1).zip becomes for the assertion comparison. This feature enables replay testing without need of manual file cleanup.

Manual download limit

When training in Chrome, you may only automatically download the file 100 times due to Chrome limits. After downloading the same file 100 times, Chrome will open a save file modal for every additional download, preventing automatic replay of the download step. Remove the downloaded files to restore replay functionality.

Running download assertions

Mabl will detect the moment a download completes and assert against it then. There is no need to add explicit waits to work with downloads, unless the download takes longer than the default 30 second download timeout. This timeout is not presently configurable.


Browser support

Assertions on PDF downloads are only supported in the following browsers:

  • Chrome
  • Firefox
  • Edge

Concurrent download support

Mabl presently supports only sequential downloads. If you have a use case requiring multiple parallel downloads, please let us know in the mabl Product Portal.