To help you cover more end-to-end testing scenarios, we’re excited to introduce GenAI Assertions for file downloads! Starting with mabl Desktop App version 2.35.25, you can use GenAI Assertions to validate downloaded content from your web app for most common file types, including spreadsheets, images, PDFs, audio, and video. For example:
- Validate that a downloaded CSV sales report contains 12 columns and that the "Total Revenue" column contains only positive numerical values.
- Assert that a downloaded audio track contains "no static background noise and the track length is between 3:00 and 3:30."
- Verify that a generated invoice shows the required legal disclaimer text in the footer.
Previously, download assertions were limited to validating metadata, such as filename, file type, and file size. With GenAI Assertions, you can validate the content of a downloaded file as well as compare it to a screenshot of the page it was downloaded from. This type of assertion allows for more complex validations to ensure that the content is accurate, compliant, and correctly formatted.
Early access
GenAI Assertions for file downloads is currently available in early access for all mabl customers and trial users via the Labs page.
Prior to general availability, changes to the feature may be made without notice.
Try it out
Before trying it out, ensure you are using mabl Desktop App version 2.35.25 or later. Then make sure that GenAI Download Assertions is enabled on the Labs page in the app: Settings > Labs. If you just enabled it, you may need to quit and restart the app to ensure the change is fully applied.
Open your web app in the mabl Trainer and, with the record button on, initiate the file download in your application. If you don’t have a convenient example to test in your app, you can try the examples in the mabl Sandbox: https://sandbox.mabl.com/downloads-pdfs.
When the download completes, the Trainer automatically adds a download assertion step and prompts you to choose next steps:
- Edit assertions - edit the existing assertions on the downloaded file’s metadata or add GenAI Assertions on the content of the downloaded file
- Skip - leave the download assertion as-is and continue training
Click on Edit assertions to edit and add assertions on the metadata or content of the downloaded file.
To assert on the content, provide a natural language prompt that describes what you would like to validate. If you need to review the file contents, click on View file. When you are ready to check your assertion, click on Test assertion.
The first time you test the assertion, mabl generates assertion criteria. These criteria are sent with the assertion description to the LLM to provide a consistent set of criteria to evaluate as part of your assertion. If you iterate on the assertion description, mabl updates the assertion criteria to reflect the current state of the description.
When the test runs in the cloud, you can review the results of the GenAI Assertion in the mabl Activity tab of the test output logs for a given step
Limitations
Execution limits
All GenAI Assertions, including download assertions, have the following execution limits:
- Limit per test: GenAI Assertions are limited to 30 per test. If they exceed this limit, the test will fail.
- Performance tests: GenAI Assertions will fail when run within the context of a performance test.
Screenshots and viewport size
When asserting against a file download, GenAI Assertions include both the contents of the downloaded file and a screenshot of the page it was downloaded from. With the page screenshot, you can create validations on data across the file and the app. For example, you could assert that the file data from a spreadsheet aligns with the product information that is visible on the current page.
Keep in mind that the screenshot only includes the portion of the page that is currently visible in the viewport. If you assert on something that isn’t fully visible in the viewport, any parts of the page that are off-screen will not be included in the evaluation. To resize the window, add a "set viewport" step before the assertion.