4 Answers, 1 is accepted
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.
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
Hello Romio,
Ivaylo
Telerik
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.
Ivaylo
Telerik
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:
Regards,
Paulo
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
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
Thank you for your input. I am quite sure it will be valuable.
I have updated your telerik points accordingly.
Regards,
Ivaylo
Telerik