What is the difference between using System.Windows.Automation and Microsoft.VisualStudio.TestTools.UITesting for WPF UI Test automation?

Deadly 提交于 2019-12-14 00:18:56

问题


What is the difference between using System.Windows.Automation (commonly known as UIA) API and Microsoft.VisualStudio.TestTools.UITesting (one that is used in Coded UI Test behind the scene) for implementing UI Test automation of a WPF application programatically?

Is there any specific scenarios, restrictions or advantages/disadvantages?


回答1:


In fact, the answer is in your question. UIA is used for automation, while UITesting is used for... testing.

An excerpt from MSDN:

UI Automation provides programmatic access to most user interface (UI) elements on the desktop, enabling assistive technology products such as screen readers to provide information about the UI to end users and to manipulate the UI by means other than standard input. UI Automation also allows automated test scripts to interact with the UI.

Thus, UIA can be used for - but isn't limited to - UITesting.




回答2:


Coded UI Tests are a framework which wraps many automation technologies. UIA is just one of them.

UIA is new in Vista/Windows 7 and it targets rich client apps, coded UI tests will use UIA when you write tests against WPF and Silverlight.

The advantage of Coded UI over using UIA directly is a lot of automatic retrys and knowledge of how UIA works is built into Coded UI tests.



来源:https://stackoverflow.com/questions/5620406/what-is-the-difference-between-using-system-windows-automation-and-microsoft-vis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!