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

IE 11 File download dialog

13 Answers 63 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Zach
Top achievements
Rank 1
Zach asked on 28 Oct 2014, 06:23 PM
I'm trying to use TTF to handle a file download in IE 11.

http://docs.telerik.com/teststudio/user-guide/write-tests-in-code/advanced-topics/handling-html-popups-and-dialogs/built-in-dialog-handlers/handling-filedownload-dialog.aspx

I tried following this guide, but it seems to only work with the older versions of IE.

The new download dialog in IE 11 looks like this:
https://social.msdn.microsoft.com/Forums/getfile/469201

13 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 31 Oct 2014, 09:10 AM
Hi Zach,

Test Studio can handle such download dialog in IE 11 without any issues.

Please send us the code you are using for handling the dialog.

A Jing video of the behavior may also help us diagnose your issue. 

Looking forward to hearing from you.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Zach
Top achievements
Rank 1
answered on 31 Oct 2014, 12:53 PM
I am using Telerik Testing Framework, not the studio.

I tried using "IEDownloadDialog"..
with ab being my active browser.

IEDownloadDialog ieDownload = new IEDownloadDialog(ab, DialogButton.SAVE, man.Desktop); man.DialogMonitor.AddDialog(ieDownload);

Is this code supposed to work?

I'm unsure of how these download dialogs are supposed to work. Do I run the "man.DialogMonitor.AddDialog(ieDownload);" line before or after IE is prompting me for the download?

I am not allowed to show you video of the site as it is proprietary.

0
Accepted
Boyan Boev
Telerik team
answered on 03 Nov 2014, 01:14 PM
Hi Zach,

Please try out this code:

DownloadDialogsHandler dialog = new DownloadDialogsHandler (Manager.ActiveBrowser, DialogButton.SAVE, @"D:\text.txt", Manager.Desktop);
 
Manager.DialogMonitor.Start();
 
Element.Click(false); //Trigger the dialog.
 
dialog.WaitUntilHandled(30000);


Let me know if this helps.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Zach
Top achievements
Rank 1
answered on 04 Nov 2014, 03:36 PM
That did the trick! Thank you very much.
0
Boyan Boev
Telerik team
answered on 05 Nov 2014, 12:27 PM
Hello Zach,

I am happy to hear that.

If you need additional assistance please let us know.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Zach
Top achievements
Rank 1
answered on 12 Nov 2014, 06:37 PM
I'm bumping this post for more help with this.

The code you gave me works, sometimes. About half of the time the the "save as" window appears and is closed without entering a filename/saving the file. this causes dialog.waitUntilHandled() to throw an exception.

Do you have any idea why this may be?
0
Boyan Boev
Telerik team
answered on 17 Nov 2014, 09:46 AM
Hi Zach,

Could you please try adding this code as the first row:

UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle

Another option is put some wait after triggering the dialog.

Give that a try and let me know the results.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Zach
Top achievements
Rank 1
answered on 17 Nov 2014, 03:02 PM
Could you clarify what I am supposed to do with that line of code? It is not valid on its own.
0
Boyan Boev
Telerik team
answered on 18 Nov 2014, 09:43 AM
Hello Zach,

Please try putting it before the code which handles the dialog:

UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
DownloadDialogsHandler dialog = new DownloadDialogsHandler (Manager.ActiveBrowser, DialogButton.SAVE, @"D:\text.txt", Manager.Desktop); 
 
Manager.DialogMonitor.Start();
 System.Threading.Thread.Sleep(1000);
Element.Click(false); //Trigger the dialog.
 System.Threading.Thread.Sleep(1000);
dialog.WaitUntilHandled(30000);

Let me know if this helps. 

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Zach
Top achievements
Rank 1
answered on 18 Nov 2014, 01:36 PM
UnexpectedDialogAction is a type and cannot be assigned to, are you sure that is the correct line of code?
0
Accepted
Boyan Boev
Telerik team
answered on 18 Nov 2014, 03:40 PM
Hi Zach,

Please excuse me, the row should be:

Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;

Let me know if this helps.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Zach
Top achievements
Rank 1
answered on 18 Nov 2014, 03:59 PM
Thanks that seems to do the trick!
0
Boyan Boev
Telerik team
answered on 20 Nov 2014, 12:23 PM
Hi Zach,

I am happy to hear that.

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