I need to verify PDF contents, when I click on pdf print button on web page, it displays PDF to print. How can I verify? Is it possible?

Selenium does not provide any API to verify the contents of a pdf. I am not sure which language binding you are using. However every language has its own specific libraries that help you achieve parsing/extracting contents of pdf. e.g. In Java you might consider using pdfbox or iText.

https://pdfbox.apache.org/

https://developers.itextpdf.com/

  • I am Using Java – Ash Oct 9 at 10:44
  • As mentioned you can think of using apache pdfbox or itext – Kshetra Mohan Prusty Oct 9 at 14:26
  • Additionally, you could looking for using rest assured instead (or complementing) Selenium, since your goal is to check the response body, instead of the interaction of the browser. – João Farias Oct 9 at 14:47

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.