我可以从 Windows From 应用程序运行编码 UI 测试吗?

发布于 2025-01-07 22:11:52 字数 60 浏览 4 评论 0原文

我可以从 Windows From 应用程序运行编码 UI 测试吗?正在寻找样品。

谢谢。

Can I run Coded-UI Tests from Windows Froms Applications? Looking for a sample.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

烂人 2025-01-14 22:11:52

当然可以 - 您可以使用 mstest.exe 命令行应用程序来运行编码的 UI 测试。您只需要编写简单的算法,确保在启动 mstest 时传递正确的参数。如需参考,请访问此处

Of course you can - you can use mstest.exe command line application for running Coded UI Tests. You just need to write simple algorithm ensuring that correct parameters will be passed while launching mstest. For reference go here

习惯成性 2025-01-14 22:11:52

您应该看看 NUnitForms,它是 NUnit 的扩展。

您的 NUnit 测试可以打开一个窗口并与控件交互。
您的测试将自动操作和验证属性
图形用户界面。 NUnitForms 负责在之间清理您的表单
测试、检测和处理模式对话框,并验证
您对测试的期望已达到。

参考此处

You should have a look at NUnitForms that is a extension to NUnit.

Your NUnit tests can open a window and interact with the controls.
Your tests will automatically manipulate and verify the properties of
the gui. NUnitForms takes care of cleaning up your forms between
tests, detecting and handling modal dialog boxes, and verifying that
your expectations for the test are fulfilled.

Reference here

就像说晚安 2025-01-14 22:11:52

另请参阅

单元测试 Winforms UI

如何对 winforms 应用程序进行单元测试

单元测试以验证 WinForms 应用程序不不要多次加载 Assembly

基本上,您最好将逻辑与 UI 完全分离,使 UI 尽可能精简,并单独测试逻辑。

see also

Unit testing Winforms UI

How to unit test winforms applications

Unit Test to verify that WinForms application doesn't load Assembly more than once

Basically you will better off separating your logic completely from the UI , making your UI as thin as possible, and testing the logic separately .

囍孤女 2025-01-14 22:11:52

您可以在此处找到解决方案控制台应用程序。您必须添加其他引用才能在 Windows 窗体应用程序或其他项目中进行测试(除了本文中列出的引用之外,我还必须添加对 Microsoft.VisualStudio.TestTools.UITest.WindowsStoreUtility 的引用) 。但正如 this so answer 中所解释的,如果您可以在打算使用这些程序集的项目中使用它,那就太好了。

You can find solution here for console application. You have to add additional references in order to work test in windows forms application or other project(I had to add reference to Microsoft.VisualStudio.TestTools.UITest.WindowsStoreUtility other than the listed refrences in the article). But as explained in this so answer it would be nice if you can use it in a project that is meant to use these assemblies.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文