'Timed out waiting '25000' msec. for download dialog to be handled.
How can I solve this problem?
By the way, my application is Silverlight application.
Thanks
15 Answers, 1 is accepted
public void ExportListingToExcel_CodedStep()
{
try
{
string saveLocation = @"C:\Telerik Automated Test\ExportedDocs\ExportedExcel.xls";
DownloadDialogsHandler handler = new DownloadDialogsHandler(ActiveBrowser, DialogButton.SAVE, saveLocation, Manager.Desktop);
handler.WaitUntilHandled(25000);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
But, ArtofTestRunner crashes after listing is exported to Excel doc. Any ideas?
Which browser are you using for testing? If IE, please make sure that "Notify me when downloads are complete" is checked as shown in the attached screen shot.
Regards,
Cody
Telerik
But, ArtofTestRunner still crashes
Now I am confused, is the runner application crashing or are you simply getting an error reported by the test "Timed out waiting '25000' msec. for download dialog to be handled"? These are two radically different symptoms with radically different causes.
I'm going to assume you just getting the error reported, not an application crash.
When the download completes in your application, do you get a notification like what is shown in the attached screen shot? If not you'll need to implement the SaveAs dialog handler in code as documented here.
Regards,
Cody
Telerik
"'Timed out waiting '25000' msec for download dialog to be handled" error is thrown (refer my first post) after listing is exported to excel If I use Test Studio to add/create the Handle Download dialog step,
ArtifTestRunner crashes after listing is exported to excel if I changed the 'Handle Download dialog' into coded step and used try...catch (refer to my second post).
Thanks
When you manually download the file using your application, do you get a Download Complete like that shown in the attached screen shot? If not you'll need to implement the SaveAs dialog handler in code as documented here.
Regards,
Cody
Telerik
The following are the library I'm using:
using Telerik.TestingFramework.Controls.KendoUI;
using Telerik.WebAii.Controls.Html;
using Telerik.WebAii.Controls.Xaml;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.IO;
using ArtOfTest.Common.UnitTesting;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.Controls.HtmlControls;
using ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;
using ArtOfTest.WebAii.Design;
using ArtOfTest.WebAii.Design.Execution;
using ArtOfTest.WebAii.ObjectModel;
using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.Silverlight.UI;
using ArtOfTest.WebAii.Win32;
using ArtOfTest.WebAii.Win32.Dialogs;
Thanks
You need:
using ArtOfTest.WebAii.Win32.Dialogs;
SaveAsDialog dlg = SaveAsDialog.CreateSaveAsDialog(ActiveBrowser, DialogButton.SAVE,
"c:\path\file.ext"
, Manager.Desktop);
// Steps to initiaate the download go here
dlg.WaitUntilHandled(30000);
Regards,
Cody
Telerik
After I changed my codes to use SaveAsDialog, file location cannot be typed in automatically. Please find the attached SaveAs dialog box screenshot. This is the dialog box we use in our application.
[CodedStep(@"New Coded Step")]
public void ExportListingToExcel_CodedStep()
{
string saveLocation = @"C:\Telerik Automated Test\ExportedDocs\ExportedExcel.xls";
SaveAsDialog dlg = SaveAsDialog.CreateSaveAsDialog(ActiveBrowser, DialogButton.SAVE, saveLocation, Manager.Desktop);
dlg.WaitUntilHandled(30000);
}
Thanks
You missed a critical part of the sequence of events. You must call SaveAsDialog.CreateSaveAsDialog before the dialog is present. Then do the action in the application which causes the dialog to open (click the Export/Save button/link or whatever it is) and finally follow that up with dlg.WaitUntilHandled.
This sequence is required because the dialog handler is only monitoring and looking for new dialogs to be created after the dialog handler object has been instantiated. It will ignore dialogs that are already open when you call SaveAsDialog.CreateSaveAsDialog.
Regards,
Cody
Telerik
No problem on export the listing into Excel - file location can be entered automatically. But, file location cannot be entered on exporting the listing to Word.
I also tried to merge two exports steps into 1 coded step and use the same handler. Still have the same issue.
But if I put export to Word and Excel into 2 different Test Case, they are running fine. Any idea?
[CodedStep(@
"ExportListingToWord_CodedStep"
)]
public
void
ExportListingToWord_CodedStep()
{
try
{
string
wordLocation = @
"C:\Telerik Automated Test\ExportedDocs\ExportedWord.doc"
;
SaveAsDialog wordhandler = SaveAsDialog.CreateSaveAsDialog(ActiveBrowser, DialogButton.SAVE, wordLocation, Manager.Desktop);
Manager.DialogMonitor.AddDialog(wordhandler);
//Code triggers the dialog
Pages.MEX.SilverlightApp.RMCWord.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, 24, 55, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Percentage, ((System.Windows.Forms.Keys)(0)));
wordhandler.WaitUntilHandled(30000);
Manager.DialogMonitor.Stop();
}
catch
(Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
Thanks
I'm pretty sure the call to:
Manager.DialogMonitor.Stop();
Is causing this problem. Stopping the dialog monitor is permanent and will stop Test Studio from handling any dialogs from that point forward. Please remove that line of code.
If that doesn't help try adding this:
wordhandler.CurrentState = DialogCurrentState.NotActive;
wordhandler.WaitUntilHandled(30000);
Regards,
Cody
Telerik
Hello Telerik Team,
I used following Code to save the downloaded to a specific path location as a child test
Dim FilePath AS String = "D:\Automation Scripts\REGRESSION SUTIE\Download Files\"
Dim FileName As String = Data("DownloadFileName")
Dim SaveLocation As String = FilePath + FileName
Log.WriteLine (SaveLocation)
Dim handler As SaveAsDialog = SaveAsDialog.CreateSaveAsDialog(ActiveBrowser, DialogButton.SAVE, SaveLocation, Manager.Desktop)
Manager.DialogMonitor.AddDialog(handler)
handler.WaitUntilHandled(30000)
handler.CurrentState = DialogCurrentState.NotActive
Test studio compiles it with no error, but i find strange my parent Test which is using this child Test passes.
Issue is
1. Save As dialog box opens but the path specified is not written on to the dialog.
2. Test step passes but action doesn't happen
3. View log displays the following for that particular child test.
pls refer to the attached log file.
Kindly help to solve the situation
​
Please try adding this code
Manager.DialogMonitor.Start()
after Manager.DialogMonitor.AddDialog(handler):
Let me know if that helps.
Regards,
Boyan Boev
Telerik