Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm beginning to explore the possibility of doing UI automation using the UI Automation library that came with .NET 3 (will be using c#). There aren't a ton of tutorials out there on this, but the ones I have seen usually involve getting the AutomationID property from a control on the application to be tested. The problem is, using UISpy and WPF Inspector, it doesn't appear that the application I'm testing has the AutomationID property populated (it's a WPF application). Also, sometimes the Name field is populated, but sometimes it's not.

Given this, is UI Automation going to be possible from the standpoint of a custom solution, or will I have to use some kind of record/playback tool (and if so, how would those tools work given the absence of these attributes)?

share|improve this question
up vote 2 down vote accepted

The answer depends on how comfortable you are programming. You can definitely find what you need using UI Automation without names and IDs. However, I found that the managed classes can find much less than the unmanaged. This post sums this up nicely:

(look at Guy Barker's response)

His point (i) is what I am doing. Point (ii) may be easier. Ultimately it is access to the Legacy Accessibility API stuff that made the difference for me.

I would suggest trying out Coded UI and Test Complete. If they can successfully find your objects and manipulate them when you playback, then you may want to go that way, but keep in mind that you will have to refactor the recordings.

If they don't work and you are comfortable programming, then definitely try out the unmanaged UI Automation stuff first.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.