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

DialogMonitor does not handle a SaveAs dialog with WPF

3 Answers 71 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
bo
Top achievements
Rank 1
bo asked on 16 Aug 2015, 04:22 PM

Hi,

 I have tried almost the whole weekend and unfortunately have no success: basically I only want to use the DialogMonitor to handle a simple SaveAs or Open dialog(both are Win32 dialog). I got always the System.TimeOutException after 60000 or after the time timeout specified with the WaitUntilHandled(2000), for example.

Here is the code I used:

    [TestMethod]
        public void Telerik()
        {
            TelerikCore.Settings mySettings = new TelerikCore.Settings();
            TelerikCore.Manager myManager = new TelerikCore.Manager(mySettings);
            myManager.Start();
 
            var wpf = System.Diagnostics.Process.GetProcesses().Where(p => p.ProcessName == "WpfApplication1");
 
            if (wpf.Count() != 0)
            {
                myManager.ConnectToApplication(wpf.FirstOrDefault());
            }
            else
            {
                myManager.LaunchNewApplication(@"D:\WpfApplication1.exe");
            }
 
            myManager.ActiveApplication.MainWindow.RefreshVisualTrees();
 
            ArtOfTest.WebAii.Win32.Dialogs.SaveAsDialog save = ArtOfTest.WebAii.Win32.Dialogs.SaveAsDialog.CreateSaveAsDialog(myManager.ActiveApplication,DialogButton.SAVE, @"C:\", "Save As");
 
            myManager.DialogMonitor.AddDialog(save);
            myManager.DialogMonitor.Start();
 
            var saveButton = myManager.ActiveApplication.MainWindow.Find.ByName("SaveButton");
            saveButton.User.Click();
 
            save.WaitUntilHandled();
        }

Please not that the application under test is a simple WPF application with two buttons: one for a SaveAs dialog and the other for a OpenFile dialog.

 Is there something wrong with the code?

 By the way, I 'm using the latest version of the Telerik Testing Framework.

 Great thanks for any tip in advance,

Thank you,

Bo

P.S. the WPF application is attached. Please rename it to an .exe file.

3 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 20 Aug 2015, 06:39 AM
Hello Bo,

Unfortunately I cannot download the application, it is giving me a broken file. Please archive it a zip file an attach it again.

Looking forward to hearing from you.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
bo
Top achievements
Rank 1
answered on 20 Aug 2015, 03:19 PM

Hi,

 

here's the zip file.

 

Regards,

Bo

0
Ivaylo
Telerik team
answered on 24 Aug 2015, 02:15 PM
Hello Bo,

Thank you for providing us with the application. I was able to reproduce the behavior and logged a bug which you can track and follow using this public link.

Unfortunately no suitable workaround can be provided. I have tested the same scenario using Test Studio and works perfectly fine there.

Thank you for your patience and understanding.

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