Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Asserting PDF Doc

Gambit
Gambit Posts: 28

I have a pretty straightforward question here. I have a GET endpoint which downloads a PDF file. Is it possible to assert the contents of the file?

Comments

  • jakubiak
    jakubiak Posts: 795 admin

    You could use a Diff Tool to do a binary comparison between the downloaded file and an expected PDF file.

  • Gambit
    Gambit Posts: 28

    Thanks jakubiak. That solution would work great, but I neglected to mention that the contents of the pdf can vary so this didn't work quite right.

    We decided to instead go with the search tool and search for the term "%PDF" which displays in the response body if a PDF GET link is hit. This seems to be adequate for our testing purposes as our scope only accounts for the actual file download.