PDF test automation, validation, and troubleshooting

Testing PDFs in mabl is as simple as testing a regular webpage, allowing you to maximize your test coverage. It's easy to automate the validation of PDF files and their contents, including capturing screenshots and detecting visual changes.

📘

Enterprise feature

This feature is available to customers on the Enterprise plan, as well as all mabl trials.

Testing PDFs

Similar to testing in iframes and in new tabs/windows, you'll need to make sure that the trainer knows that you're testing a new PDF page.

First, verify that the "Record" button at the top is active and new steps are being recorded.

  • If your PDF is embedded directly in the web page under test, you will see the mabl PDF viewer in place of the normal viewer.
  • If the PDF opens full screen, or downloads, click on the PDF you'd like to open and interact with. When you do so, the PDF will be downloaded and you'll be prompted to select that you would like to test the PDF within the mabl trainer itself. When you click "YES", mabl will open the PDF in a new tab.

Now you're ready to start testing normally! You're able to test normally using assertions, creating new variables, using JavaScript snippets, and most steps. You can use the Downloads and PDFs section of the sandbox app to practice.

800800

mabl supports both downloaded PDFs, as well as those embedded directly in an HTML page using <embed> or <object> tags.

🚧

Current limitations

There are some basic limitations when testing PDFs, as they sometimes can be set up differently than a standard webpage. That being said, we try our best to simplify the testing process.

  • Supported browsers are Chrome, Firefox, and Edge.
  • PDFs that are generated via an HTTP POST request are only supported when encoded as 'x-www-form-urlencoded'.
  • Due to restrictions in Chrome, blob URL PDFs can be trained against when embedded, or downloaded, but not when the blob URL is directly opened, i.e. the location bar URL starts with 'blob://'
  • The Trainer cannot make assertions against documents that are solely images, such as scans.
  • There is no support for filling out PDF forms.

PDF troubleshooting

PDF assertion is failing
Check if the PDF is being open in the default Chrome PDF viewer or the mabl PDF viewer. If the PDF is opened in the Chrome PDF viewer, you will have to record the download of the PDF and save the file anywhere.

250250

Downloading the PDF will prompt the trainer to open the mabl PDF viewer, click YES

598598

You will then see the trainer download and will be able to assert against the PDF

595595

Did this page help you?