Unable to download the excel file from 'Download Dialog' in IE
Please find below code and also please find attached screen shot for the dialog box.
My System Configuration: VSTS 2012, Telerik Test Framework( Nunit template) ,Window7 and IE9.
namespace TestProject2
{
public class TelerikNUnitTest1 : BaseTest
{
public void SampleWebAiiTest()
{
Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
ActiveBrowser.NavigateTo("http://192.168.10.65/Login.aspx");
string saveLocation = string.Format("address-{0:HH-mm-ss}.xls", DateTime.Now);
//Create dialogs
IEDownloadDialog part1 = new IEDownloadDialog(ActiveBrowser, DialogButton.SAVE, Manager.Desktop);
Manager.DialogMonitor.Start();
SaveAsDialog part2 = SaveAsDialog.CreateSaveAsDialog(ActiveBrowser, DialogButton.SAVE, @"C:\Users\1029\Desktop\ExportTest" + saveLocation, Manager.Desktop);
IEDownloadCompleteDialog part3 = new IEDownloadCompleteDialog(ActiveBrowser, DialogButton.CLOSE, Manager.Desktop);
//Add each dialog to the monitor
Manager.DialogMonitor.AddDialog(part1);
Manager.DialogMonitor.AddDialog(part2);
Manager.DialogMonitor.AddDialog(part3);
System.Threading.Thread.Sleep(30000);
Manager.ActiveBrowser.RefreshDomTree();
//Clicking on below button ‘Save Dialog’ will open
Find.ById<HtmlInputImage("ctl00_ctl00_PageContentPlaceHolder_PageContentPlaceHolder_TrademarkSearchSearchResults_ExportExcelButton").Click();
Manager.ActiveBrowser.RefreshDomTree();
ActiveBrowser.WaitUntilReady();
part1.WaitUntilHandled();
part2.WaitUntilHandled(30000);
part3.WaitUntilHandled(30000);
System.Threading.Thread.Sleep(10000);
System.Threading.Thread.Sleep(10000);
}
}
}
I am getting below exception in debug mode for'part1.WaitUntilHandled();' code line
‘Time Out Exception was unhandled by user code. Time Out waiting ‘60000’ msec. for any dialog to be handled.
And In Run mode below trace is observed
[Trace] : Unexpected dialog encountered. Closing the dialog, and halting execution.
Please help me how to save excel file from IE9 download dialog and also please find attached screen shot for dialog box.