The UI Automation framework has a base class, AutomationElement, that has a property, ItemStatus, that can be used to store arbitrary strings. I'm trying to get that property from the Visual Studio 2010 Coded UI Tests base class, UITestControl.
相关问题
- VNC control for WPF application
- WPF Binding from System.Windows.SystemParameters.P
- XAML: Applying styles to nested controls
- How can I add a horizontal line (“goal line”) for
- How to properly change a resource dictionary
Look at the Coded UI Tests generated code for
WpfControl
. It has a property, NativeElement. This property is anAutomationElement
.You can write an extension method to cast it and get ItemStatus.
I am not certain why NativeElement is recorded as an
object
(which makes the getter cast redundant). All WPF controls' NativeElement are of typeAutomationElement
. I would suggest editing the generated code and simply callingcontrol.NativeElement.Current.ItemStatus
directly.