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

'Save As' dialog on IE 9

1 Answer 101 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Julio
Top achievements
Rank 1
Julio asked on 22 May 2013, 08:39 PM
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.

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 27 May 2013, 03:19 PM
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
Tags
General Discussions
Asked by
Julio
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or