Adding download assertions

Important information about using the mabl trainer

For more information on the mabl trainer, please see the "Defining a journey with the mabl trainer".

Adding download steps in your mabl trainer

mabl detects and adds download steps automatically whenever a download completes during a training sessions.

  1. Start a new journey or edit/retrain an existing journey.
  2. Trigger the download of interest (e.g. click download link/button)
  3. Upon download completion, mabl will show a new step for your download.
Automatically captured download step.

Automatically captured download step.

Working with download assertions

By default downloads will assert against the name of the downloaded file. You may add/edit additional assertions by clicking the edit icon on the download assertion step.

Editing the default download assertion.

Editing the default download assertion.

Waiting on Downloads

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.

Download Auto-numbering Removal

Browsers add numbers to repeatedly downloaded files. For example, foo.zip 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 foo.zip for the assertion comparison. This feature enables replay testing without need of manual file cleanup.

Additional Assertions include

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

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.

Concurrent Download Support

mabl presently supports only sequential downloads. If you have a use case requiring multiple parallel downloads, please let us know via Feature Requests.

Browser Support

Training: Google Chrome
Cloud Execution: Google Chrome, Firefox