Completed

VERIFY_TEXT_IN_PDF error "Cannot get the PDF document server..."

I'm trying to read a text in PDF file, the PDF is a downloaded file which I opened it in browser, now when I use "VERIFY_TEXT_IN_PDF" command I get below error:

Cannot get the PDF document server message:sun.net.www.protocol.file.FileURLConnection cannot be cast to java.net.HttpURLConnection

Is it because I opened the file locally? and if so, is there any other way to read these PDF files?

1
5 comments

Official comment

Avatar
Joseph Hamdan

Hasib,

We have added support for local PDF files in version 8.10.0. It will be available to you when you plan to upgrade.

The release note below shows how you can use it:

* Fixed several issues with Verify_Text_In_PDF and added support for local PDF files. To verify from a local file, simply add the path of the download file in a Goto_url step followed by the file name and extension. For example, "C:\Users\username\Downloads\file.pdf". The next step will verify the text in PDF which is opened

Thank you for using Subject7.

Regards,

Subject7 Team

Comment actions Permalink
Avatar
Joseph Hamdan

Hasib,

Verify_Text_in_PDF works only when the PDF file is opened via the browser automatically. Can you try the steps mentioned below to prevent the PDF file from downloading and allow it to open automatically? 

Google Chrome:

https://support.google.com/chrome/answer/6213030?hl=en

Firefox:

https://support.mozilla.org/en-US/kb/change-firefox-behavior-when-open-file

 

Please let us know if this does not work.

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
Hasib Rostaiee

Joseph,

I followed the steps mentioned in the google support, the download files instead of automatically open in chrome is already turned off. Unfortunately, the files I'm working on are system generated and they do not have a web URL. 

In my test case however, I opened the file in browser by copy and pasting the local Path (i.e. file:///C:/proof/Automation_Downloads/....) but still I get the issue. 

Thanks,

0
Comment actions Permalink
Avatar
Pavel Kasper

Hi Hasib. Thank you for reporting the issue about the VERIFY_TEXT_IN_PDF command. Local file reading support will be added in 8.10.0.

1
Comment actions Permalink
Avatar
Hasib Rostaiee

Thank you Pavel, this will be very helpful.

0
Comment actions Permalink

Please sign in to leave a comment.