简体   繁体   English

代码步骤后录制(WPF测试)-Telerik Test Studio

[英]Recording After Code Step (WPF Test) - Telerik Test Studio

I am testing a WPF App with Telerik Test Studio. 我正在用Telerik Test Studio测试WPF应用程序。 My App is started from a ClickOnce shortcut. 我的应用是从ClickOnce快捷方式启动的。 Here are the steps that i did: 这是我执行的步骤:

1 - Start Test Studio and create a WPF test 1-启动Test Studio并创建WPF测试

2 - Add a Code Step in my WPF test 2-在我的WPF测试中添加代码步骤

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: 3-使用http://docs.telerik.com/teststudio/user-guide/code-samples/wpf/connect-to-running-wpf-app.aspx中的代码段连接到正在运行的WPF应用程序:

// 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! 所有这些步骤都工作正常!

I'm trying to figure out how to attach the recorder to the running Wpf-App Window after the code step. 我正在尝试找出在代码步骤之后如何将记录器附加到正在运行的Wpf-App窗口的方法。

Thanks 谢谢

You can do a Run To Here to the coded step. 您可以对编码步骤执行此处运行 What will Test Studio do is to run the test and after the coded step is executed the recorder will be automatically attached so you can continue recording. Test Studio的作用是运行测试,执行编码步骤后,记录仪将自动连接,因此您可以继续记录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM