Why Choose Coded UI?

If you are looking for an automated testing solution for your WinForms applications, Microsoft Coded UI is definitely an option to consider. Comprehensive integration with Microsoft IDE tools and services, extensibility, and Microsoft quality are just a few of the reasons so many software organizations turn to Coded UI.

Of course, if your applications use DevExpress WinForms Controls, Coded UI's advantages over competing technologies is unrivaled because of the native support offered by DevExpress.

Abstraction Levels

When combining a testing framework with 3rd party controls, you want to avoid low-level testing that simply records mouse movements in pixel coordinates. There are many things that can go wrong in such a scenario – a control moves to a new position, a new item is added to the list, etc...

High-level testing transforms pixel coordinates, mouse movements and keystrokes into meaningful actions such as the reordering of columns or changing cell values.

Native Support from DevExpress

Most testing frameworks implement support for DevExpress Controls. These third-party vendors study our controls and take the necessary steps to transform low-level actions into meaningful test scripts. These vendors are experts in their field and we readily collaborate with them to improve support for our products.

With Microsoft Coded UI, however, DevExpress has written the necessary extensions to make our controls recognizable by Microsoft's framework. The abstraction level issue is resolved by DevExpress R&D and since we know our controls best, we are able to guarantee comprehensive and up-to-date coverage. This means that you will never end up stuck with a new control or feature that is not properly recognized by the testing framework. Additionally, you are ensured a consistent API – you will write test scripts using the same syntax as that used when coding against our controls.

Coded UI Does Not Equal MSAA

When you begin researching Coded UI, you will undoubtedly encounter information that describes how controls can interact with Coded UI as long as they implement support for Microsoft Active Accessibility (MSAA). This, in fact, is what many of our competitors do - they claim support for MSAA and thus support for Coded UI.

As you can probably imagine, effective support of Coded UI is not that simple. Coded UI does use MSAA, but chances are that most controls have minimal MSAA implementation – just enough to claim Section 508 Support. To allow for comprehensive testing you need to extend the MSAA interface and if that has not been done, you can expect significant obstacles when using Coded UI.

While MSAA is used for both accessibility and testing purposes, you need different implementations for these two features. For comprehensive testing, you need to implement the following:

  • Test recording and playback support
    Make certain that all required elements are exposed via MSAA interfaces so that the test uses high-level abstraction instead of pixel coordinates.
  • Custom property validation
    Extend accessibility objects with properties that might be needed for assertions.
  • Actions filters (allowing Intent-Aware or Aggregated action support)
    You can control the level of detail when recording your automated tests. When working with a data editor, chances are you need to know that the edit value has changed, not each individual click within the dropdown window. If you are dragging a dock window, you need to know its final position, not its path there.
  • Code generation
    You will need to maintain tests and may need to write them manually. For this purpose, it's best to have a simple testing API for your objects that resemble the control's API in order to leverage existing knowledge.

If a vendor claims that Coded UI is supported simply because of support for MSAA, you can be sure that your testing capabilities will be limited by only the first item in the list above. It remains to be seen in each individual case how well that first item is supported. The bottom line is this: MSAA support guarantees nothing.

DevExpress WinForms Controls on the other hand, have full support for all those automated testing requirements. We've taken the time to learn the framework and implement extensions making our control library fully compatible with Coded UI.

DevExpress Controls with Coded UI in Action

In this section, we'll take a closer look at each of the testing features mentioned above and see them in action.

Individual Element Recognition

This is a fundamental area in our testing extensions. All our controls are divided into individual elements that can be recognized by the testing framework. For instance, when you switch tabs, drag column headers or edit cell values, Coded UI works directly with these elements, not screen coordinates.

Intent-Aware or Aggregated Actions

Say you focused a combo box editor, clicked its dropdown button, scrolled the list and selected the third item from bottom. When testing, you don't really need to this level of detail. It's not relevant how you used our controls to achieve the required result. Maybe you used the mouse wheel to scroll through the list or maybe you entered a few characters and then used the Auto-Complete feature... This all is unnecessary information for testing, because you are not testing DevExpress controls. All that matters is that the editor's value changed from X to Y. This is the only result that relates to application logic.

Another good example is setting a grid's filter condition via the built-in dialog. All you need to know is that the filter condition changed to another string. No matter how much time you spent within the dialog and how complex the filter tree is, testing only cares about the resulting filter criterion.

This is how our controls actually work when used in combination with Coded UI. We use Action Filters to aggregate numerous clicks and keystrokes into actions that matter for the testing process.

Hand-Coding Tests

A significant amount of effort was invested by the DevExpress R&D team to deliver API consistency. This simplifies the code generated by the testing framework and allows you to hand-code your tests using properties and methods much like that used within your application.

Note the API simplicity in the following screenshot demonstrating how you can hand-code a test for the DevExpress WinForms Grid Control.

Assertions

Assertions are the essence of each test. Once everything has been done, you need to validate the result and this is where you add an assertion. For utmost flexibility, each DevExpress control or control element exposes properties accessible via Coded UI script recording windows. While most elements normally only expose their content (text), our extensions give you many more attributes including element position within the control.

Final Thoughts

This section summarizes our recommendations on automated testing. As always, there's no single path and no single solution...you should carefully research your options and choose the solution that best addresses your business needs.

DevExpress WinForms Controls + Microsoft Coded UI

Unlike many vendors claiming support for Coded UI through the simple use of MSAA, we went the extra mile to make certain that our controls fully comply with Microsoft's testing framework. We don't simply support Coded UI; we support it to the maximum extent possible.

All in all, Coded UI from Microsoft is a solid framework with tight integration across a broad range of Microsoft technologies, including Visual Studio and Test Manager. If you have chosen to develop a WinForms application using DevExpress Controls and require an automated testing tool, we strongly recommend that you consider Coded UI in your project.

Please note: Coded UI support ships as part of the DevExpress Universal Subscription only.

DevExpress eXpressApp Framework + DevExpress EasyTest

This white paper focuses on Coded UI, but if you are developing a WinForms business application, we also recommend that you try out our eXpressApp Framework. It ships with its own integrated testing framework and a myriad of other features optimized for business application development.

Best in Class Tools

DevExpress is honored to have been voted best in class 19 times in this year's Visual Studio Magazine Reader's Choice Awards.

Experience the DevExpress difference and see why your peers consistently vote our products #1. With our Universal Subscription, you will build your best, see complex software with greater clarity, increase your productivity and create stunning applications for Windows, Web and your Mobile world.

x19
x18
x13
x8

Buy this product as part of the following subscription packages.

We are so confident in our products and services that we back them with a 60 day no questions asked money back guarantee. If within the first 60 days of ownership you are not satisfied with the capabilities of our tools, you can request a full refund of the amount you paid to DevExpress by writing to clientservices@devexpress.com or by calling +1 (818) 844-3383.

Best Value
WinForms Controls
WPF Controls
ASP.NET WebForms Controls
Printing & Exporting
ASP.NET MVC Extensions
Printing & Exporting
ASP.NET Bootstrap Controls
Themes and Skinning
ASP.NET Core Bootstrap Controls
Themes and Skinning
JavaScript - jQuery, Angular, React
JavaScript - ASP.NET MVC & Core
UWP Controls
Reporting
WinForms Report Viewer
WinForms End-User Report Designer
HTML5 Report Viewer
ASP.NET Report Viewer
ASP.NET End-User Report Designer
MVC Report Viewer
MVC End-User Report Designer
WPF Report Viewer
WPF End-User Report Designer
Office File API (Basic)
Excel Export Library
Word Processing Document API (DOC, RTF)
Office File API (Complete)
Spreadsheet Document API (XLSX, XLS)
Excel Export Library
Word Processing Document API (DOC, RTF)
PDF Document API
DevExpress Snap Report API
Barcode Generation API
Zip Compression and Archive API
Unit Conversion API
Native Mobile UI Controls
Charting Library
iOS Controls
Android Controls
Xamarin Wrappers
CodeRush
VS 2017 Support
VS 2015 Support
Roslyn-Powered Superior Performance
C#, VB.NET, XAML
CodeRush Classic
VS 2015 Support
VS 2012, 2013 Support
C#, VB.NET, XAML
HTML, ASP.NET, CSS, Razor, JavaScript
Coded UI Support for WinForms Controls
Source Code *
WinForms Controls
ASP.NET Controls
WPF Controls
UWP Controls
JavaScript - jQuery, Angular, React
XPO - ORM Library
Office File API
Data Visualization Dashboard
eXpressApp Framework
Technical Support
Priority Support

* DevExpress does not include/ship source code for certain products, including CodeRush, TestCafe, and Report Server.

Additional Info

WinForms Themes and App Skins

The DevExpress WinForms Subscription ships with 50 custom designed and highly polished themes for your next WinForms application. You can use each of these themes easily, without modification or manipulate them using our free WinForms Skin-Theme Editor application. Learn more

Touch Enabled User Experience

Deliver elegant, touch-enabled WinForms applications using the platform you know and love. The WinForms Subscription helps you leverage your current investments and address customer needs via a comprehensive range of WinForms controls that support touch on both Windows 7 and Windows 10.

Sec 508 and Accessibility

The DevExpress WinForms Subscription makes it easy to create WinForms applications that meet government regulations regarding web accessibility. Sec 508 and Accessibility Guidelines 1.0 support is available for key DevExpress WinForms controls.

Straightforward Localization

All DevExpress WinForms controls can be localized using satellite resource assemblies. DevExpress delivers satellite assemblies for a large variety of languages and cultures. To help you get started, resource files for four cultures are included in our installation: German, Japanese, Russian, and Spanish. If you need to modify our shipping resources or create satellite assemblies for a different language, simply use our Online Localization Service, a free tool for our active WinForms subscribers. Online Localization Service

Testing Support

The DevExpress Universal Subscription includes built-in support for Microsoft's CodedUI. Unlike many vendors claiming support for Coded UI through the simple use of MSAA, DevExpress controls go the extra mile to make certain that individual controls fully comply with Microsoft's testing framework. We don't simply support Coded UI; we support it to the maximum extent possible. Note: CodedUI support requires purchase of the DevExpress Universal Subscription. Learn more

MVVM Framework

The DevExpress MVVM Framework ships with features that are absent in WinForms, but essential to MVVM development. These missing features include bindings, commands, UI triggers, behaviors etc. Our Framework includes all of these along with a straightforward API to make WinForms app development more efficient. Learn more