Skip to main content
Experience faster, smarter testing with BrowserStack AI Agents. See what your workflow’s been missing. Explore now!
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

Validate downloaded file and its content

Learn how to effectively validate the metadata and content of files downloaded during test execution using Low Code Automation.

Low Code Automation simplifies the process of validating file downloads and their content. It lets you automate the verification of key metadata such as file name, size, extension, and content accuracy using MD5 checks. Low Code Automation also supports validating content-level details, even for dynamic files with changing data.

Whether downloading invoices, statements, reports, or other documents from a website, Low Code Automation ensures that files meet expected metadata criteria and contain the correct and relevant information. This end-to-end validation capability reduces manual effort, improves reliability, and enhances the overall accuracy of automated workflows.

The Validate downloaded files and their content feature is available exclusively in the Low Code Automation Pro plan. For more details, contact us.

When testing file downloads, it’s important to validate both metadata (like file name, type, and size) and content (for formats like PDF or CSV). In Low Code Automation, these validations can be seamlessly added during test recording.

Validate metadata of the file

  1. In Low Code Automation, when you click on any element that triggers a file download during test recording, a step is automatically recorded to validate the metadata of the downloaded file.
  2. Click the Validate file.pdf downloaded with name, type and size step.
  3. Under the Validations section, configure the following checks:
    • File name: Enter the expected name of the file. For example, Report_2025. You can filter the file name by checking if it equals, contains, starts with, not equals, not contains or not starts with the captured value.
    • File type: Specify the expected file type. For example, pdf, csv, xlsx. You can filter a file type to check if it is equals or not equals to the captured value.
    • File size: Enter the expected file size in KB, MB and GB. You can filter a file’s size to check if it is greater than, greater than or equal to, less than, or less than or equal to the captured value.
    • Content validation: Enable this toggle to add validation to the file content using MD5 checks. An MD5 checksum is a 32-character hexadecimal number that is computed on a file. If two files have the same MD5 checksum value, then the contents of the two files are the same. In Low Code Automation, an MD5 hash of the file content is automatically generated during recording which is compared with the one generated during replay to ensure the content matches. This check is preferable for static content only.
  4. Click Save recording.

Validate contents of the PDF or CSV file

If the file type is PDF or CSV, Low Code Automation also allows you to validate its contents:

  1. Upon opening the file, a dialog box prompts you to validate the content. Click Open PDF or Open CSV. The file opens in a new browser window. Content validation is currently supported only for PDF and CSV files.
  2. Alternatively, you can click the Validate (file) downloaded step and click Open to validate content. Open file from the validate page
  3. Perform actions or validations on the file contents as you would do on a normal web page to record the steps. Enable MD5 checks to validate file content
  4. Optionally, click Download to view to manually inspect the file.
  5. Click Save recording.

Edit the file download checks

  1. Go to All tests and select the required test.
  2. Click the Tests steps tab and click the Validate file downloaded step. Edit the file download validation without recorder
  3. In the step page, you can modify the validations for file name, file type, file size and content validation.
  4. Click Save recording.

Below is a sample test run showing successful file download validations. View file download step passed

To view the details of the passed validations, including file name, size, extension, and content, click See details.

View file download passed details

File download limitations

  • Due to Chrome’s security restrictions, PDF files served via blob: URLs can be validated when they are embedded in the page or downloaded programmatically. However, if the file is opened directly in a new tab and the address bar starts with blob:, validations may not work as expected.
  • On Safari, PDF files may open directly in the browser’s built-in preview instead of triggering a download. In such cases, the file is not accessible for validation.
  • Files larger than 25 MB are currently not supported for validation.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle