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

Download PDF from a link

1 Answer 167 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Carl
Top achievements
Rank 1
Carl asked on 26 Feb 2013, 03:44 PM
Hi there
        one of our applications uses a PDF to display some information to the user, now I know that test studio doesn’t support PDF documents either in a browser or standalone, but I have been able to do some testing of the PDF file using the iTextSharp library for c#, the only problem is I need the file to be on my local hard disk and I don’t know how to get test studio to download the PDF from the link. Basically I want test studio to right click the link and select "save target as..." and then save the file to my hard drive. How do I do that?

Thanks

Carl

1 Answer, 1 is accepted

Sort by
0
Accepted
Boyan Boev
Telerik team
answered on 26 Feb 2013, 05:37 PM
Hello Carl,

Test Studio is able to download a file directly with a left click on the link.

I recorded a short video as a demonstration. 

If it is really necessary to be with a right click you should use Desktop Mouse Click (see attached screen shot) and then via a coded step press down arrow four times (if the "Save target as" is the 4th from the top in the context menu for example) and hit Enter:

this.Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Down,500,4);
this.Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter,100,1);

Note that you need to add an assembly reference to System.Windows.Forms.dll and a using statement for the System.Windows.Forms namespace. 

As a last step you should have again Handle "Download" dialog step.

Here is another video that demonstrates it.

Hope this helps.


All the best,
Boyan Boev
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Carl
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or