This all depends upon how much detail you need to go into.
If you just want to check based on filename all you need to do is parse the src attribute of your link. If you want to physically load up the PDF and check it you'll need to use some external libraries and the process is not straight forward.
Before going down this path ask yourself what the benefit is.
· Is the PDF likely to have an incorrect filename?
· If you load the PDF up how much actual checking are you going to do?
· Would it be enough to just know the filename and filesize?
· Could you download it and do an MD5/SHA1 hash to determine it’s the correct file without loading it up and checking the content?
If you are determined to do more than check the filename you will first of all need to download the PDF using something like my Downloader Class. You can then check filesize and/or perform an MD5/SHA1 hash to confirm that it is the file you expect.
If you want to go further and load the PDF up and validate parts of its content you will then need to write a PDF handler, a quick google brings up http://pdfbox.apache.org/ which looks like it will probably meet your requirements.
This is all very Java orientated (because I use Java). The principle will be the same for other languages.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
I have told you that already, read my previous message again, specifically the part about creating a PDF handler.
I suspect all you really need to do is download the file and MD5/SHA1 hash it and compare it to an MD5/SHA1 hash of a known good copy of the file. It will be much easier than writing a PDF handler.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/-500fqNCNB8J.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/tzVYvcmryo4J.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/tzVYvcmryo4J.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
Hi Tribhuvan Yadav,
======================
Create a EXE file
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to
selenium-user...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/selenium-users?hl=en.
There I times when I wonder why I bother posting.
You cannot handle PDF’s with Selenium, the only way you can do it is to write your own PDF handler, this *will* involve downloading the PDF to parse it.
PDF’s are displayed in the browser by loading the flash plugin, they are not rendered as HTML and will never be able to be read by Selenium.
From: seleniu...@googlegroups.com [mailto:seleniu...@googlegroups.com] On Behalf Of Tribhuvan Yadav
Sent: 24 April 2012 18:03
To: seleniu...@googlegroups.com
Subject: Re: [selenium-users] Unable to handle the pdf file
santosh,
when i click the link , which results in opening a pdf file in browser.. i doing like this
selenium.selectwindow() to the newly open window
and then selenium.isTextpresent();
when i run it.. selenium is unable identify the new window.. and my test case gets failed
thanks
Tribhuvan
On Tue, Apr 24, 2012 at 10:29 PM, SantoshSarma <santosh...@gmail.com> wrote:
@Krishnan : I think it is not possible but, I think we can verify text using selenium.isTextPresent() method. (I didn't try just my assumption)
On Tuesday, April 24, 2012 9:52:50 PM UTC+5:30, Krishnan wrote:
I dont think you will be able to extract any text out of a web browser window that is showing a pdf file.
Thanks & Regards
Krishnan Mahadevan
"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
On Tue, Apr 24, 2012 at 9:36 PM, SantoshSarma <santosh...@gmail.com> wrote:
Hi Tribhuvan,
Whether that pdf file will open in browser or anyother ?
If it opens in browser, and you want search some names, content (text) then go for isTextPresent() method
On Tuesday, April 24, 2012 7:15:56 PM UTC+5:30, Mark Collin wrote:
I have told you that already, read my previous message again, specifically the part about creating a PDF handler.
I suspect all you really need to do is download the file and MD5/SHA1 hash it and compare it to an MD5/SHA1 hash of a known good copy of the file. It will be much easier than writing a PDF handler.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/-500fqNCNB8J.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/tzVYvcmryo4J.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.