I like to test an application with the Microsoft UI Automation and I got stuck in triggering a tree item's double click event.
Dim parent As AutomationElement
Dim child As AutomationElement
parent = <Code to retrieve parent element>
'expand the parent item
DirectCast(parent.GetCurrentPattern(ExpandCollapsePattern.Pattern), ExpandCollapsePattern).Expand()
'retrieve the child
child = parent.FindFirst(TreeScope.Descendants, New PropertyCondition(AutomationElement.NameProperty, <Name of the child element>))
This child
object is the tree item in question, but it's only offering the ExpandCollapsePattern
and the SelectionItemPattern
, both of them are not helpful in triggering the double click event.
I tried to expand this item in order to maybe triggering the double click event that way, but I only got an error telling me that expanding is not possible.
So, what am I missing?
Thank you very much in advance.