Winappdriver: how to get attribute of LegacyIAccessible.State

Created on 22 Apr 2019  Â·  3Comments  Â·  Source: microsoft/WinAppDriver

I'm trying use the function attribute("LegacyIAccessible.State") but get nil

how to get property of "LegacyIAccessible.State" ?

my inspect.exe result of window:
How found: Selected from tree...
Name: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
ControlType: UIA_MenuItemControlTypeId (0xC35B)
LocalizedControlType: "功能表項目"
IsEnabled: true
IsOffscreen: true
IsKeyboardFocusable: false
HasKeyboardFocus: false
AccessKey: "s"
ProcessId: 0
RuntimeId: [Error: hr=0xFFFFFFFF80040201 - UIA_E_ELEMENTNOTAVAILABLE]
AutomationId: "63001"
IsControlElement: true
IsContentElement: true
ProviderDescription: "[pid:20724,providerId:0x0 Annotation:Microsoft: Annotation Proxy (unmanaged:uiautomationcore.dll); Main(parent link):Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]"
IsPassword: false
HelpText: ""
IsDialog: [Not supported]
LegacyIAccessible.ChildId: 10
LegacyIAccessible.DefaultAction: "執行"
LegacyIAccessible.Description: ""
LegacyIAccessible.Help: ""
LegacyIAccessible.KeyboardShortcut: "s"
LegacyIAccessible.Name: "xxxxxxxxxxxxxxxxxxxxxx"
LegacyIAccessible.Role: 功能表項目 (0xC)
LegacyIAccessible.State: 一般 (0x0)
LegacyIAccessible.Value: ""
IsAnnotationPatternAvailable: false
IsDragPatternAvailable: false
IsDockPatternAvailable: false
IsDropTargetPatternAvailable: false
IsExpandCollapsePatternAvailable: false
IsGridItemPatternAvailable: false
IsGridPatternAvailable: false
IsInvokePatternAvailable: true
IsItemContainerPatternAvailable: false
IsLegacyIAccessiblePatternAvailable: true
IsMultipleViewPatternAvailable: false
IsObjectModelPatternAvailable: false
IsRangeValuePatternAvailable: false
IsScrollItemPatternAvailable: false
IsScrollPatternAvailable: false
IsSelectionItemPatternAvailable: false
IsSelectionPatternAvailable: false
IsSpreadsheetItemPatternAvailable: false
IsSpreadsheetPatternAvailable: false
IsStylesPatternAvailable: false
IsSynchronizedInputPatternAvailable: false
IsTableItemPatternAvailable: false
IsTablePatternAvailable: false
IsTextChildPatternAvailable: false
IsTextEditPatternAvailable: false
IsTextPatternAvailable: false
IsTextPattern2Available: false
IsTogglePatternAvailable: false
IsTransformPatternAvailable: false
IsTransform2PatternAvailable: false
IsValuePatternAvailable: false
IsVirtualizedItemPatternAvailable: false
IsWindowPatternAvailable: false
IsCustomNavigationPatternAvailable: false
IsSelectionPattern2Available: false

Most helpful comment

Try "LegacyState" rather than "LegacyIAccessible.State".

All 3 comments

Try "LegacyState" rather than "LegacyIAccessible.State".

This worked to me.
I was looking for "LegacyIAccessible.Name" and I used "LegacyName"

I'v try @ShyAlex way, but what I get is a number not string,
if the State isSelected or Checked, then it can help,
but sometime need more information.
thanks a lot, guy!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Iziksh picture Iziksh  Â·  3Comments

quincycs picture quincycs  Â·  3Comments

didhddldlq picture didhddldlq  Â·  3Comments

Blank517 picture Blank517  Â·  4Comments

pcbt picture pcbt  Â·  4Comments