What is the attached property AutomationProperties.AutomationId for?

Topics: Prism v4 - Silverlight 4
Jul 3, 2012 at 4:11 PM
Edited Jul 3, 2012 at 5:01 PM

What is the attached property AutomationProperties.AutomationId for?

<sdk:DataGrid x:Name="EmployeesList"
            Grid.Row="1"
            Grid.Column="0"
            Grid.ColumnSpan="2"
            SelectionMode="Single"
            ItemsSource="{Binding Path=Employees}"
            AutoGenerateColumns="False"
            Margin="8"
            AutomationProperties.AutomationId="EmployeesListGrid">
Developer
Jul 3, 2012 at 6:03 PM

Hi,

As far as I know, the attached property AutomationProperties.AutomationId is from the Microsoft UI Automation framework and is used in the UI Composition QuickStart Acceptance Tests to identify a specific element of the UI. In this case, the aforementioned property is used to identify the DataGrid of the EmployeeListView so that it can be accessed by the UI Automation tests. You can find the testing solution of this QuickStart inside its UIComposition.Tests.AcceptanceTest folder.

Based on my understanding, this property is not used by Prism or WPF / Silverlight and it's not required when creating Prism applications.

If you are interested in UI Automation tests, I believe you might find the following MSDN articles useful:

However, take into account that Prism doesn't provide official guidance about testing or UI Automation.

Regards,

Damian Cherubini
http://blogs.southworks.net/dcherubini

Jul 4, 2012 at 3:03 PM

Thank you Damian for answering