I am Facing Problems in Handling Download Dialogs in IE 9, I used the Code Snippet below:-
This Code works in IE 8, but not in IE 9
//Code to Handle the IE Download DialogBox
IEDownloadDialog iedownload = new IEDownloadDialog(Manager.ActiveBrowser, DialogButton.OPEN, Manager.Desktop);
//Handles the Dialog Pop-up
Manager.DialogMonitor.AddDialog(iedownload);
Please help me how to Resolve this problem in IE9 first
Also I want solution for All other Browsers (FF, Chrome, Safari)
Thanks
Nitin
17 Answers, 1 is accepted
Please try using our DownloadsDialogHandler as shown at the bottom of that page instead. It handles the download dialogs across all browsers.
Greetings,Cody
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

//Code to Handle the IE Download DialogBox
IEDownloadDialog iedownload = new IEDownloadDialog(Manager.Current.ActiveBrowser, DialogButton.SAVE, Manager.Current.Desktop);
//Handle SaveAs Dialog
SaveAsDialog saveAsDialog = SaveAsDialog.CreateSaveAsDialog(Manager.Current.ActiveBrowser, DialogButton.SAVE, filePath, Manager.Current.Desktop);
//Handle DownLoad Complete Dialog
IEDownloadCompleteDialog downloadClose = new IEDownloadCompleteDialog(Manager.Current.ActiveBrowser, DialogButton.CLOSE, Manager.Current.Desktop);
//Handles the Dialog Pop-up
Manager.Current.DialogMonitor.AddDialog(iedownload);
//Handles the Dialog Pop-up
Manager.Current.DialogMonitor.AddDialog(saveAsDialog);
//Handles the Dialog Pop-up
Manager.Current.DialogMonitor.AddDialog(downloadClose);
//Wait for Save Image Button button Exists in DOM
//Click on Save Image Button
Trigger the Action (Click on Save Image Button)
//Handle the IE Dialog
iedownload.WaitUntilHandled(20000);
//Handle the SaveAs Dialog
saveAsDialog.WaitUntilHandled(20000);
//Unable to Handle
downloadClose.WaitUntilHandled(2000);
try
{
if (File.Exists(filePath) == true)
{
Manager.Current.Log.WriteLine("File Exists");
}
else
{
throw new FileNotFoundException("File does not Exists", fileName);
}
}
finally
{
// Wait for 2000 milisec
System.Threading.
Thread.Sleep(2000);
Manager.Current.DialogMonitor.Stop();
// Removing IEDownload Dialog From DialogMonitor
Manager.Current.DialogMonitor.RemoveDialog(iedownload);
// Removing saveAsDialog Dialog From DialogMonitor
Manager.Current.DialogMonitor.RemoveDialog(saveAsDialog);
// Removing downloadClose Dialog From DialogMonitor
Manager.Current.DialogMonitor.RemoveDialog(downloadClose);
// Dispose the Current Manager
//Manager.Current.Dispose();
In that Case My Download Compelte Dialog is NOT CLOSED in IE 8, I am Stuck where is the Problem
Please Help, Also the Same Code is NOT EXECUTED on IE 9.0
First, as I previously stated, please switch to our DownloadDialogsHandler as shown in this code sample:
//Code to Handle the IE Downloads
DownloadDialogsHandler DownloadHandler =
new
DownloadDialogsHandler(Manager.Current.ActiveBrowser, DialogButton.SAVE, filePath, Manager.Current.Desktop);
Manager.DialogMonitor.Start();
PUT CODE HERE THAT INITIATES THE DOWNLOAD
//Wait until the download is complete
DownloadHandler.WaitUntilHandled(20000);
try
{
if
(File.Exists(filePath) ==
true
)
{
Manager.Current.Log.WriteLine(
"File Exists"
);
}
else
{
throw
new
FileNotFoundException(
"File does not Exists"
, fileName);
}
}
finally
{
// Wait for 2000 milisec
System.Threading.
Thread.Sleep(2000);
Manager.Current.DialogMonitor.Stop();
}
Greetings,
Cody
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

This solution works while Debugging, but i am getting another error
I am attaching snapshot
When I Run that Script, this will not handle the the Download Dialog in IE 9 and Yellow bar appears and nothing hapens
Thanks
Nitin
I have never seen such an error before and have no idea what could be causing it or where it is even coming from. Can you send me a complete test project that reproduces this symptom I can analyze to try and determine what is causing it?
If you can't send a project that I can run against your website, see if you can reproduce the problem in a new test against this website: http://www.thinkbroadband.com/download.html.
Cody
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Hi Cody
Attaching the Error.swf as well as my Demo Project.
Tested against this URL:
http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/applicationscenarios/filteranddownloadfiles/defaultcs.aspx
While debugging this Error appears and my File does not get saved.
Our Application behavior is similar to this.
Thanks
Nitin


Is there any way to handle the Download Dilaog in Both IE8 as well as IE9 or we have to write Different Handling Methods for each browsers
Sometimes IE9 yellow Notification area does not handled Properly
I am unable to Select Save as from the IE 9 Notofification Area using
DownloadDialogsHandler DownloadHandler =
new
DownloadDialogsHandler(Manager.Current.ActiveBrowser, DialogButton.SAVE, filePath, Manager.Current.Desktop);
Manager.DialogMonitor.Start();
Thanks
It is supposed to be automatic so that you don't need to worry about it. However we discovered earlier today that our download dialog handling in IE8 is broken. We will get this fixed ASAP. You can track the PITS Issue here.
Please wait until we come out with a fix for this. Then the same code should work across all browsers, all versions. Also you can see this forum post for a possible temporary work around.
Cody
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Is there any way to handle the Download Dilaog in Both Chrome 16.0.912.77 m as well as Firefox 9.0.1.
I am unable to Save as from the Chrome 16.0.912.77 m as well as Firefox 9.0.1
Area using
DownloadDialogsHandler DownloadHandler =
new
DownloadDialogsHandler(Manager.Current.ActiveBrowser, DialogButton.SAVE, filePath, Manager.Current.Desktop);
Manager.DialogMonitor.Start();
PUT CODE HERE THAT INITIATES THE DOWNLOAD Like Click Event
//Wait until the download is complete
DownloadHandler.WaitUntilHandled(20000);
Its not handle dialog box and not typing the file path as well.
I am Totally stuck please help out :( :(
My Scripts are failed while running this code in Chrome 16.0.912.77 m as well as Firefox 9.0.1
I am Using Telerik.Testing.Framework.2011.2.1305
Regards,
Rohit Malhotra

How to Handle Save As Dialog in Cross Browsers using Same Code, as I seen from Rohit's Snapshot he was facing problem in Handling SaveAs Dialogs
there are different Classes
DownloadDialogs Handler
SaveAsDilaog
Please provide Generic Solution for Handling these as it Supports All Major Browsers, but my Code is Running only in IE
Thanks
The DownloadDialogsHandler is intended to work in all four browsers. As Cody stated, it currently isn't working in IE8 so you'll need to use his proposed work-around.
If you're having difficulty with Firefox downloads, ensure you configured according to these instructions.
The following code worked for me in IE9, FF 9.0.1, Safari 5.1.2, and Chrome 16.0.912.63:
Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
ActiveBrowser.NavigateTo(
"http://databases.about.com/od/tutorials/a/excelsample.htm"
);
string
saveLocation =
string
.Format(
"address-{0:HH-mm-ss}.xls"
, DateTime.Now);
DownloadDialogsHandler handler =
new
DownloadDialogsHandler(ActiveBrowser, DialogButton.SAVE, @
"C:\"
+ saveLocation, Desktop);
HtmlAnchor dlLink = Find.ByContent<HtmlAnchor>(
"Sample Address File"
);
dlLink.Click();
System.Threading.Thread.Sleep(3000);
handler.WaitUntilHandled(30000);
Anthony
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Thanks for your quick reply..............
This code is working well while we trying it your sample application.
But if application behavior is different this code doesn't works well like my application(I am using SILVER LIGHT Application)
In my application while click on download link its always take the file save path which used last time (like i used c:\myfolder\rrr.xlx) its always take the same please see screenshot
(silverlightdownloadsaveas.png).
If I changed browser setting then no effect on behavior of the application it behaves the same as shown in screenshot (silverlightdownloadsaveas.png) (browsersetting.png)
either I checked the ( Ask where to save each file before downloading ) or not its shown me the same window always please see the screenshot (silverlightdownloadsaveas.png)
I am totally stuck please provide me specific resolution for that :( :( :(
Hope this time u'll provide me the resolution even after understand the behavior of my application.
Thanks

Could you please schedule a Meeting with Us
I am a Licensed User, as you can see from my Profile
My Location is in India
I am facing Problems in Handling Dialogs in Cross Browses(Chrome, FireFox, IE9)
We have Requirement to Test our Automation Scrpts in ALL Latest Browsers
Please Help I am Stuck and Waiting
Regads
Rohit
as a paying customer, you are indeed entitled to a GoToMeeting. I've been assigned to arrange and carry out the GoToMeeting since I'm much closer to your timezone.
I noticed that you have two accounts both under your name but only one of those is listed as a licensed developer for Test Studio. I would like to ask you to open a Support ticket from the other account so that we may discuss the details of the GoToMeeting in our confidential support ticket system. It's more appropriate than a public forum.
Regards,
Stoich
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

I am already generated the support ticket for it details are as follows:-
- Ticket ID: 506342
- Status: Open
- Response deadline: 72
- Last reply date: 22 hours ago
- Type: Support
- Product: Test Studio
Thanks
Rohit

Thank you for Providing Workaround(directly type the Path with Desktop.Keyboard) for this Issue.
Regards
Nitin