Is UI Automation really a good choice for the WPF application testing?

853 Views Asked by At

When talking about automating the UI tests conversation always ends up with the UI Automation. Is it the only option?

I personally don't like it for one main reason - complexity. It is designed to be universal for all the types of applications. Such universality never comes for free. UIA introduces another layer of abstraction and a rather complicated API. The standard patterns are limited. Custom controls support requires a lot of coding. I wonder why anyone considers it to be a good option?

WPF has a brilliant and a very rich abstraction where the UI is a hierarchical tree of visual elements. These elements expose lots of methods, events and properties. The tree supports various ways of referring (relative source syntax for instance). And we loose all this might in UIA. For what? For the compatibility with the old-school apps and web? Well, realistically, who would need that? Jack of all trades is a master of none.

Tools like Snoop can inject themselves into a running application and get the full control over it. They can change the values of control properties and raise events. Won't that be enough? Nope. You'd want your test to interact with the UI as the user would do - using mouse and keyboard. But that's another problem which can be solved.

So I wonder, is there something I don't get about the joy of UIA?

0

There are 0 best solutions below