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

Problem with OpenFileDialog handling

3 Answers 95 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Oleksii
Top achievements
Rank 1
Oleksii asked on 10 Apr 2018, 09:53 AM

I have next code to handle OpenFileDialog in WPF app tests:

var dialog = OpenFileDialog.CreateOpenFileDialog(Manager.ActiveApplication, DialogButton.OPEN, pathToImportFile, "Open");
Manager.DialogMonitor.AddDialog(dialog);
Manager.DialogMonitor.Start();
importStep1.Find.ByType("RadButton").User.Click();
dialog.WaitUntilHandled(10000);

 

But sometimes my test doesn't work correctly. The dialog box remains open (with correct title - "Open"), but I have next erroe:

Message: System.TimeoutException : Timed out waiting '10000' msec. for any dialog to be handled '1'

 

This happens in half of the cases when the same test is run, without any changes.

3 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 13 Apr 2018, 08:41 AM
Hello Oleksiy,

Usually such sporadic behavior is related to a timing issue. Did you try increasing the timeout of WaitUntilHandled to 15000 or 20000?

Please try increasing the timeout and if the problem reoccur let us know.

Regards,
Ivaylo
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Oleksii
Top achievements
Rank 1
answered on 13 Apr 2018, 04:54 PM
Timeout increasing doesn't help. Problem that dialog is opened in few seconds, but dialog monitor can't detect it.
0
Elena
Telerik team
answered on 18 Apr 2018, 02:51 PM
Hi Oleksii,

Thank you for getting back to us. 

Please let me know if there is any chance the active user session is lost in the cases when the dialog is not recognized? 

Since the issue is intermittent it is very hard to find out what might be causing it. Therefore it will be very helpful if you are able to find out anything specific that appears in the faulty executions. 

Thank you in advance for your cooperation and understanding! 

Regards,
Elena Tsvetkova
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Oleksii
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Oleksii
Top achievements
Rank 1
Elena
Telerik team
Share this question
or