Validate HTML popup load a PDF file

5 posts, 0 answers
  1. Romio
    Romio avatar
    2 posts
    Member since:
    Oct 2013

    Posted 03 Nov 2013 Link to this post

    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.
  2. Daniel
    Daniel avatar
    13 posts
    Member since:
    Aug 2013

    Posted 04 Nov 2013 Link to this post

    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.
  3. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 07 Nov 2013 Link to this post

    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!
  4. Paulo
    Paulo avatar
    12 posts
    Member since:
    Jun 2013

    Posted 20 Feb 2014 Link to this post

    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
  5. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 20 Feb 2014 Link to this post

    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!
Back to Top