Saturday, October 29, 2011

Adding full Coded UI support to third party WinForm components that don't already have it...

Visual Studio ALM + Team Foundation Server Blog - Coded UI Test Extension for 3rd party Windows Forms controls–How to?

"Here is how one can add FULL Coded UI Test support for a 3rd party control based on Windows Forms technology.

Implementation Method – Accessibility

Accessibility means having equal access to web-based information and services regardless of physical or developmental abilities or impairments. Once implemented, it helps developers make their programs more compatible with accessibility aids (help users with impairment to use programs more effectively).

Microsoft has developed two accessibility standards - Microsoft Active Accessibility (MSAA) and Microsoft UI Automation (UIA)

MSAA is designed to help Assistive Technology (AT) products interact with standard and custom user interface (UI) elements of an application (or the operating system), as well as to access, identify, and manipulate an application's UI elements including enabling automation testing.

UIA is a newer technology that provides a much richer object model than MSAA, and is compatible with both Win32 and the .NET Framework. It is designed so that it can be supported across platforms other than Microsoft Windows.

We recommend MSAA for Windows Forms because Windows Forms natively supports MSAA and not UIA. Although there is MSAA to UIA & vice-versa conversion available via built-in proxy\bridge but the results in an extra layer of dependency which could eat into performance, hence MSAA.

Why Accessibility for Coded UI Test?

1. Implementing accessibility is simpler because one needs to follow established guidelines that serve the purpose of developing testable as well as accessible controls in one go

2. There is not much need to write an entire plugin for controls as much of the work is already done. We have built plugins for Windows Forms and Windows Presentation Foundation controls using accessibility technologies and have exposed appropriate extension points for easy hook-up

3. Vendors such as Telerik who develop 3rd party controls have already announced accessibility implementation

Detailed steps with reference to Coded UI Test Extension for 3rd party controls - the basics explained



Yes, this is WinForm related information, but like it or not, in the real world WinForms are still heavily used. Anyway, I dug how this showed off adding Coded UI testing to about any third party WinForm component...

No comments: