Open and Verify a pdf file | Selenium Forum
M
Posted on 01/08/2016
Hi,

The scenario is - that i have to download and open a pdf file and check if it has opened or not.

frFile = new File(path);
if ((frFile).toString().endsWith(".pdf")) {
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + frFile);

i tried this .. but it didnt work

M
Replied on 01/08/2016

https://www.seleniumeasy.com/selenium-tutorials/how-to-extract-pdf-text-and-verify-using-selenium-webdriver-java

http://roadtoautomation.blogspot.in/2013/04/road-to-verify-pdf-file-text-using-java.html

http://stackoverflow.com/questions/941813/how-can-i-determine-if-a-file-is-a-pdf-file


M
Replied on 02/08/2016

How can we verify text from a pdf file?


M
Replied on 02/08/2016

you'll have to use PDFBox. it like POI api is for excel.