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.



| improve this answer | |
  • I am Using Java – Ash Oct 9 '18 at 10:44
  • As mentioned you can think of using apache pdfbox or itext – Kshetra Mohan Prusty Oct 9 '18 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 '18 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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