'Save As' dialog on IE 9

2 posts, 0 answers
  1. Julio
    Julio avatar
    3 posts
    Member since:
    Jul 2011

    Posted 22 May 2013 Link to this post

    Hi Everyone,

    I'm using the free Telerik framework, version 2011_1_502. We currently use IE 8 for our tests and I'm trying to run tests on IE 9. Ideally we would like to keep using the same framework version on IE 9; we have a vast amount of tests, and upgrading the framework would entail converting the code and testing all tests on both browsers, which would take a very long time.

    The issue I currenty face is handling the download dialog on IE 9. I'm able to save a file, but it goes to the default directory (doesn't do Save As).

    Here is what we use for IE 8 (doesn't work on IE 9):

    manager.DialogMonitor.AddDialog(ieDownloadDialog);
    manager.DialogMonitor.AddDialog(saveas);
    manager.DialogMonitor.AddDialog(ieDownloadCompleteDialog);
    manager.DialogMonitor.Start();
      
    button.Click();
      
    ieDownloadDialog.WaitUntilHandled(CurrentEnvironment.LargeTimeOut);
    saveas.WaitUntilHandled(CurrentEnvironment.LargeTimeOut);
    //ieDownloadCompleteDialog.WaitUntilHandled(CurrentEnvironment.TimeOut);
      
    manager.DialogMonitor.RemoveDialog(ieDownloadDialog);
    manager.DialogMonitor.RemoveDialog(saveas);
    manager.DialogMonitor.RemoveDialog(ieDownloadCompleteDialog);
    manager.DialogMonitor.Stop();
    I also tried the following and it doesn't work:

     

    var handler = new DownloadDialogsHandler(activeBrowser, DialogButton.SAVE, path, desktop);

    The following is what saves file, but it doesn't specifiy the location given on the variable path, it just saves to the default directory and default filename:
     

    button.Download(false, DownloadOption.Save, path, 60000);

    Can anyone help with this? Thanks in advance.

  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 27 May 2013 Link to this post

    Hello Julio,

    I was able to reproduce the behavior you're describing. It turned out that the issue is related to the UnexpectedDialogAction setting.

    Sometimes for Test Studio it is hard to determine whether the dialog is "expected" or "unexpected" and it tries to handle it automatically. Setting the UnexpectedDialogAction to DoNotHandle should resolve this. You can do that from the testsettings file as seen in this article or you can do that in code like this:
    Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
     
    See this video for more information and let me know if you need further assistance on this.

    Regards,
    Plamen
    Telerik
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top