Why AutomationProperties are needed in WPF

.net, ui-automation, wpf

Solution

Let’s think about a text box, in your application it is the PhoneNumberTextBox, and you also have a PhoneNumberLabel, and PhoneNumberValidationTick. These are then displayed inside of a group box with a label showing “Customer”

A blind person trying to use your application would like the screen reader to say “Customer Phone Number” when they tab into the text box, likewise a tester writing an automated UI test for your application would like to be able to find the text box that contains the “Customer Phone Number”.

Now what if your application has been translated to German…. Would the blind user not want the screen reader to say ”Kundentelefonnummer“?

Now imagine you change your app to use a PhoneNumberInputControl, you will likely want to change the names of the control in your code, but the tester would rather wish that the control name does not change….

So we need the concept of a name that is used by programs that try to walk the “important” logical controls of an application at run time and automate something about how a user interacts with the application.

Problem

As per my understanding, AutomationProperties can be utilized to identify names of controls by UI Automation clients. I want to understand need to create separate set of automation properties, and not using x:Name for the same purpose.

Original source

Related problems