简体   繁体   English

是否可以将编码的UI测试仅用作UI自动化?

[英]Is it possible to use coded UI testing as just UI automation?

Recently I have been doing a lot of coded UI testing in visual studio 2013. And then I got to wondering: Is it possible to write a coded UI test, not to test an application for stability/safety/proper behavior, but to just click through the Windows UI to perform a repetitive action? 最近,我在Visual Studio 2013中进行了很多编码UI测试。然后我想知道:是否可以编写编码UI测试,而不是测试应用程序的稳定性/安全性/正确行为,而只需单击通过Windows UI执行重复操作?

I'm sure that there are other, less roundabout ways to automate actions on a Windows UI though, but I don't know where to start looking. 我敢肯定,虽然还有其他一些less回绕的方法可以自动执行Windows UI上的操作,但是我不知道从哪里开始。 Can I get some suggestions on what to look up? 我可以得到一些有关查找内容的建议吗?

You can execute your Coded UI Scripts with MSTEST.exe. 您可以使用MSTEST.exe执行编码的UI脚本。 On top of that you can create console application to execute test cases directly with a simple click on Batch Trigger. 最重要的是,您可以创建控制台应用程序,只需单击批触发即可直接执行测试用例。

refer sample code for main method in console app below 请参阅下面的控制台应用程序中主要方法的示例代码

 static void Main(string[] args)
        {
            Playback.Initialize();
            CodedUITests.CodedUITTest test = new CodedUITests.CodedUITTest();
            test.Testmethod1();
            Playback.Cleanup();
        }

refer http://chamindac.blogspot.in/2014/03/execute-coded-ui-test-with-console.html for details. 有关详细信息,请参见http://chamindac.blogspot.in/2014/03/execute-coded-ui-test-with-console.html

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

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