IE 11 File download dialog

14 posts, 2 answers
  1. Zach
    Zach avatar
    33 posts
    Member since:
    Sep 2014

    Posted 28 Oct 2014 Link to this post

    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
  2. Boyan Boev
    Admin
    Boyan Boev avatar
    1045 posts

    Posted 31 Oct 2014 Link to this post

    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
     
  3. Zach
    Zach avatar
    33 posts
    Member since:
    Sep 2014

    Posted 31 Oct 2014 in reply to Boyan Boev Link to this post

    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.

  4. Answer
    Boyan Boev
    Admin
    Boyan Boev avatar
    1045 posts

    Posted 03 Nov 2014 Link to this post

    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
     
  5. Zach
    Zach avatar
    33 posts
    Member since:
    Sep 2014

    Posted 04 Nov 2014 in reply to Boyan Boev Link to this post

    That did the trick! Thank you very much.
  6. Boyan Boev
    Admin
    Boyan Boev avatar
    1045 posts

    Posted 05 Nov 2014 Link to this post

    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
     
  7. Zach
    Zach avatar
    33 posts
    Member since:
    Sep 2014

    Posted 12 Nov 2014 in reply to Boyan Boev Link to this post

    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?
  8. Boyan Boev
    Admin
    Boyan Boev avatar
    1045 posts

    Posted 17 Nov 2014 Link to this post

    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
     
  9. Zach
    Zach avatar
    33 posts
    Member since:
    Sep 2014

    Posted 17 Nov 2014 in reply to Boyan Boev Link to this post

    Could you clarify what I am supposed to do with that line of code? It is not valid on its own.
  10. Boyan Boev
    Admin
    Boyan Boev avatar
    1045 posts

    Posted 18 Nov 2014 Link to this post

    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
     
  11. Zach
    Zach avatar
    33 posts
    Member since:
    Sep 2014

    Posted 18 Nov 2014 in reply to Boyan Boev Link to this post

    UnexpectedDialogAction is a type and cannot be assigned to, are you sure that is the correct line of code?
  12. Answer
    Boyan Boev
    Admin
    Boyan Boev avatar
    1045 posts

    Posted 18 Nov 2014 Link to this post

    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
     
  13. Zach
    Zach avatar
    33 posts
    Member since:
    Sep 2014

    Posted 18 Nov 2014 in reply to Boyan Boev Link to this post

    Thanks that seems to do the trick!
  14. Boyan Boev
    Admin
    Boyan Boev avatar
    1045 posts

    Posted 20 Nov 2014 Link to this post

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