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

Recording After Code Step (WPF Test)

5 Answers 146 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Hicham
Top achievements
Rank 1
Hicham asked on 22 Aug 2014, 10:52 AM
Hello Everybody

I am testing a WPF App. My App is started from a ClickOnce shortcut. Here are the steps:

1 - Start Test Studio and create a WPF test

2 - Add a Code Step in my WPF test

3 - Using the snippets in http://docs.telerik.com/teststudio/user-guide/code-samples/wpf/connect-to-running-wpf-app.aspx to connet to my running WPF App:

// close the mock app
ActiveApplication.Quit();
 
string appPath = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Programs), @"\MyWPFApp\DEVELOPMENT\MyWPFApp.appref-ms");
 
System.Diagnostics.Process.Start(appPath);
 
var runningApp = System.Diagnostics.Process.GetProcesses().Where(p => p.ProcessName == "MyAPP");
             
while (runningApp.Count() == 0)
 {
     runningApp = System.Diagnostics.Process.GetProcesses().Where(p => p.ProcessName == "MyAPP");
}
 
 Manager.ConnectToApplication(runningApp.FirstOrDefault());
 
while(!Manager.ActiveApplication.Process.WaitForInputIdle())
 
Manager.ActiveApplication.MainWindow.RefreshVisualTrees();
 
ActiveApplication.WaitForWindow("My App");

All these steps work fine but how can i record my steps in Test Studio Standalone after the code step.

Thanks
Hicham

5 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 25 Aug 2014, 12:59 PM
Hi,

Have you tried the Run - To Here option of the test explorer? It will execute the test to the specified step (inclusive) and attach the recorder to the application for you to proceed recording the next steps. See this article for the test explorer options.

Regards,
Konstantin Petkov
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Hicham
Top achievements
Rank 1
answered on 25 Aug 2014, 01:52 PM
Hi,

Yes i tried the Run - To Here option of the test explorer. It will execute the test to the specified step and try to attach the recorder to the mock app not the real app.

Is there a possibility to attach the recorder to a specific Window in code?

Thanks
Hicham
0
Ivaylo
Telerik team
answered on 28 Aug 2014, 12:34 PM
Hello Hicham,

Please check this article on how to connect to a running WPF application.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Hicham
Top achievements
Rank 1
answered on 11 Sep 2014, 09:15 PM
Hi,

I just posted a solution to this problem in my blog in case that someone has the same problem.

Regards
Hicham

0
Ivaylo
Telerik team
answered on 16 Sep 2014, 11:58 AM
Hello Hicham,

I am glad to hear you have found a solution and for the nice blog post about Test Studio. 

I am updating your telerik points, and once again thank you for the efforts.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Hicham
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Hicham
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or