【发布时间】:2018-04-19 22:31:28
【问题描述】:
我喜欢使用 Microsoft UI 自动化测试一个应用程序,但我被困在触发树项目的双击事件中。
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>))
这个child 对象是有问题的树项,但它只提供ExpandCollapsePattern 和SelectionItemPattern,它们都对触发双击事件没有帮助。
我试图展开这个项目,以便以这种方式触发双击事件,但我只收到一个错误,告诉我无法展开。
那么,我错过了什么?
非常感谢您。
【问题讨论】:
标签: .net ui-automation