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?
Selenium is a well-known open-source UI test automation tool widely utilized in the testing industry. It can automate test scripts on various operating systems, including Linux, Mac, Windows, and browsers, including Chrome, Firefox, Internet Explorer, and Headless Browsers.
Automation Expert. Windows Presentation Foundation (WPF) is a common framework used by developers to build applications for a Windows Operating System (OS).
Microsoft UI Automation is an accessibility framework for Microsoft Windows. It addresses the needs of assistive technology products and automated test frameworks by providing programmatic access to information about the user interface (UI).
Coded UI (also called CUIT) is an automation testing tool provided by Microsoft technologies which helps in creating automated tests. The Coded UI tests help us verify the whole application such as User Interface and their functioning properties.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With