title | description | type | page_title | slug | tags | res_type |
---|---|---|---|---|---|---|
Read WPF AutomationProperties in Test Studio |
Learn how to read WPF AutomationProperties in Test Studio. |
how-to |
Read WPF AutomationProperties in Test Studio |
read-wpf-automation-properties |
automation, WPF, Test Studio |
kb |
How to read WPF AutomationProperties
in Test Studio.
Automation properties are defined as a set of an attached properties of a WPF element, so you can read them using GetAttachedProperty
method.
Here's an example of how to read the ItemStatus
property:
var itemStatus = <Your-Wpf-Element>.GetAttachedProperty<string>("System.Windows.Automation.AutomationProperties", "ItemStatus");
Note The code above will work only when automation property values are set in the XAML of your WPF application.