This is a migrated thread and some comments may be shown as answers.

Validate HTML popup load a PDF file

4 Answers 47 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Romio
Top achievements
Rank 1
Romio asked on 03 Nov 2013, 05:40 AM
Hi there,,
In our application we have HTML popup load a PDF file.
My question is there is any way to validate the data in this HTML popup that loaded a PDF file...???

Regards,
Romio
Q.A.

4 Answers, 1 is accepted

Sort by
0
Daniel
Top achievements
Rank 2
answered on 04 Nov 2013, 02:19 PM
Are you looking to validate the content of the PDF, or just strictly inspect the HTML of the popup window?

As far as I know, there is no out of the box solution for Test Studio and validating the content of a PDF.  There are open source libraries out there (http://sourceforge.net/projects/pdfsharp/, http://sourceforge.net/projects/clown/) that you could use coded steps on to do some validation if necessary.
0
Ivaylo
Telerik team
answered on 07 Nov 2013, 09:10 AM
Hello Romio,

As Daniel stated if you are looking to validate the content of the PDF file that will not be possible with Test Studio. This is because a PDF file loaded in the browser does not have a DOM structure like a traditional web page, so Test Studio cannot read or verify against its contents.
Thank you for your understanding.

@Daniel thank you for assisting the customer, I have updated your telerik points accordingly.

Regards,
Ivaylo
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Paulo
Top achievements
Rank 2
answered on 20 Feb 2014, 01:50 PM
I had this issue in last days. I have to do some validations in my application user guide, that opens on a new IE window.

Since Test Studio is unable to work with PDFs, I've managed an external solution that validates the browser URL.

For that, if you use Visual Studio, in the project references add the COM reference Microsoft Internet Controls. This DLL is incompatible with Test Studio, since it isn't a .Net reference, but it will be created a compatible dll, in mt case on my project folder/obj/debug. The dll is Interop.SHDocVw.dll

Now, all you have to do is add this reference to the project references in Test Studio, and from now on you have access to that PDF popup window

That's an example code:

01.// Will look in iexplore processes for the expected URL.
02.SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindows();
03.foreach (SHDocVw.InternetExplorer ie in shellWindows)
04.{
05.        filename = System.IO.Path.GetFileNameWithoutExtension(ie.FullName).ToLower();
06.        if (filename.Equals("iexplore") )
07.        {
08.                Console.WriteLine("Web Site   : {0}", ie.LocationURL);
09. 
10.                userGuideFound = true;
11.                // Closes IE window.
12.                System.Threading.Thread.Sleep(500);
13.                ie.Quit();
14.                System.Threading.Thread.Sleep(500);
15.                break;
16.        }
17.}

Regards,
Paulo
0
Ivaylo
Telerik team
answered on 20 Feb 2014, 04:02 PM
Hello Paulo,

Thank you for your input. I am quite sure it will be valuable.

I have updated your telerik points accordingly.

Regards,
Ivaylo
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Romio
Top achievements
Rank 1
Answers by
Daniel
Top achievements
Rank 2
Ivaylo
Telerik team
Paulo
Top achievements
Rank 2
Share this question
or