控制模式可用性设置为true但返回“Unsupported pattern。”exception
使用托管UI自动化 ,我正在尝试访问Chrome的标签项的SelectionItem控件模式 。
使用Inspect.exe
我注意到这些AutomationElement
的IsSelectionItemPatternAvailable
设置为true ,这对应于TabItem的文档,声明“标签项控件必须支持SelectionItemPattern” 。
但是,当我尝试检索控件模式时,我得到一个InvalidOperationException
,指出该模式不受支持。
var select = tab.GetCurrentPattern( SelectionItemPattern.Pattern );
我做错了什么,或者这只是Chrome提供商实施中的一个错误?
我还尝试调用GetSupportedPatterns()
,它返回一个空集合。