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

How to handle complete notification bar in IE9?

1 Answer 70 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dmitry
Top achievements
Rank 1
Dmitry asked on 01 Aug 2013, 03:24 PM
Hi to all.


Given: file that needed to be downloaded by clicking on button(btnExportProfile)

Code: 

DownloadDialogsHandler part1_0 = new DownloadDialogsHandler(myManager.ActiveBrowser, DialogButton.SAVE, @"C:\", myManager.Desktop);
 
SaveAsDialog part2_0 = SaveAsDialog.CreateSaveAsDialog(myManager.ActiveBrowser, DialogButton.SAVE, @"", myManager.Desktop);
 
IE9DownloadCompleteNotificationBar dlComplete1 = new IE9DownloadCompleteNotificationBar(myManager.ActiveBrowser, DialogButton.CLOSE);
             
myManager.DialogMonitor.AddDialog(part2_0);
myManager.DialogMonitor.AddDialog(dlComplete1);
 
myManager.ActiveBrowser.Find.ById<HtmlControl>("btnExportProfile").Click();
 
System.Threading.Thread.Sleep(10000);
part1_0.WaitUntilHandled(40000);
part2_0.WaitUntilHandled(40000);
dlComplete1.WaitUntilHandled(50000);

The problem is: "complete notification" bar is always visible and cannot be closed. Seems  IE9DownloadCompleteNotificationBar does not work correctly.

1 Answer, 1 is accepted

Sort by
0
Velin Koychev
Telerik team
answered on 06 Aug 2013, 08:14 AM
Hi Dmitry,

It would be easier to use our more complete dialog handler class 'DownloadDialogsHandler' which wraps the individual parts into one fully integrated class.  You can read more about handling file download dialogs in this article.
Here is sample code how you can use it:
Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
            ActiveBrowser.NavigateTo("http://www.who.int/inf-new/txt.htm");
            string saveLocation = string.Format("address-{0:HH-mm-ss}.xls", DateTime.Now);
              
            //Create dialogs
            DownloadDialogsHandler dialog = new DownloadDialogsHandler(ActiveBrowser, DialogButton.SAVE, @"C:\" + saveLocation, Manager.Desktop);
              
            //Clicking on below button ‘Save Dialog’ will open         
            Find.ByTagIndex<HtmlImage>("img", 108).Click();
            //Wait until dialog is handled
            dialog.WaitUntilHandled(30000);

I hope this helps.
 
Regards,
Velin Koychev
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Dmitry
Top achievements
Rank 1
Answers by
Velin Koychev
Telerik team
Share this question
or