UI 自动化和 WPF 的经验 [英] Experiences with UI Automation and WPF

查看:31
本文介绍了UI 自动化和 WPF 的经验的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个相当大的基于 WPF 的应用程序,并希望在我们的测试套件中包含一些自动化的 UI 测试(其中已经包含了许多单元测试).

We are developing a rather large WPF based application and would like to include some automated UI testing in our test suite (which already contains a number of unit tests).

UI 自动化框架来自Microsoft 部分听起来非常适合在测试设置中以编程方式启动应用程序并与之交互.但是,我一直在努力寻找有关该技术的样本和经验的可靠参考资料,MSDN 上提供的文章和小样本不足以让我相信它是一个可靠的选择.

The UI Automation Framework from Microsoft partly sounds like a perfect fit for programatically launching and interacting with the application in a test setup. However, I've struggled to find solid references for samples and experiences with the technology, the articles and small samples available on MSDN is not enough to convince me that it is a solid choice.

那么,有人在他们的测试套件中使用 UI 自动化框架吗?有哪些注意事项和问题?编写测试脚本时的任何最佳实践,您是否可以记录和重放"为可编写脚本的格式,您应该在多大程度上促进应用程序的测试,您如何将其合并到自动构建中?除了 UI 自动化框架,我们是否应该寻找另一个方向?

So, does anybody have real world experiences using the UI Automation Framework in their test suite? What are the caveats and the gotchas? Any best practices when written tests scripts, can you "record and replay" to a scriptable format, how much should you facilitate the testing from the application, how did you incorporate it in the automatic build? Should we be looking in another direction than the UI Automation Framework?

请随时在此处发布您的经验或链接到我可能错过的一些好的参考资料

Feel free to post you experiences here or link to some good references I might have missed

推荐答案

在我工作的地方,我们刚刚开始为我们的系统评估一些测试工具.我们遇到了一个名为 white 的工具,它使用了 UI 自动化框架.请注意,white 也有记录功能,尽管我认为它看起来有问题并且仍在开发中.

Where i work we have just started to evaluate some test tools for our system. We came across a tool called white, which uses the UI Automation Framework. Note that white does also have a record function although i think it has looks of issues and is still being developed.

我们尝试做的是将它们设置为看起来像单元测试,即 [TestFixture] [Test] 等.然后我们就可以在单元测试的同时通过 nunit 运行它们.

What we tried doing was set them up to look like unit tests i.e. [TestFixture] [Test] etc. then we were able to run them through nunit at the same time as the unit tests.

我们发现访问窗口中的某些组件可能很困难,但没有太多机会调查原因.

We have found that it can be difficult to access some of the components within your window, but haven't had much of a chance to investigate why.

如果您不介意为软件付费,那么我建议您使用 TestComplete.

If you don't mind paying for the software then I would recommend TestComplete.

这篇关于UI 自动化和 WPF 的经验的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆