Inspect.exe显示IsSelectionPatternAvailable
是true
,但是当调试在VS2013 SelectionItemPattern
,只是引发错误:IsSelectionPatternAvailable是真实的,但GetCurrentPattern(SelectionItemPattern.Pattern)中断
An unhandled exception of type 'System.InvalidOperationException' occurred in UIAutomationClient.dll, Additional information: Unsupported Pattern.
IE 11.0 + Win7的64位,谁能帮我?
Dim cond1 = New PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Tab)
Dim cond2 = New PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.TabItem)
Dim tab = AutomationElement.FromHandle(browserHandle).FindFirst(TreeScope.Descendants, cond1)
Dim tabs = tab.FindAll(TreeScope.Children, cond2)
For i = 0 To tabs.Count - 1
Dim tabA = tabs(i)
Dim a As SelectionItemPattern = tabA.GetCurrentPattern(SelectionItemPattern.Pattern)
Next