I do automation for WPF application using UIAutomation API. Everything went fine until I hit the Ribbon control. I have no trouble to see information about Ribbon and its children through the Inspect.exe, but inside the code I cannot obtain the information about those elements.
It other words, in this code aeElement is always null:
aeElement = aeForm.FindFirst(TreeScope.Children,
new PropertyCondition(AutomationElement.NameProperty, "XXX"));
I tried TreeScope.Descendants
and TreeScope.Elements
.
I tried AutomationElement.ControlTypeProperty
and AutomationElement.AutomationIdProperty
.
I tried TreeWalker
– nothing worked.
Wondering if there is a solution for that issue? Thank you very much in advance.
EDIT: There is no answer at http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/home?forum=windowsaccessibilityandautomation either.