When I trying to get Toolstrip element
ToolStrip toolStrip = StartApplication.Window.Get<ToolStrip>(SearchCriteria.ByText("Toolbar"));`
this error occurs :
error: Failed to get ControlType=tool bar,Name=Toolbar
Toolbar properties are:
- Name: "Toolbar"
- ControlType: UIA_ToolBarControlTypeId (0xC365)
- LocalizedControlType: "tool bar"
- IsEnabled: true
- IsOffscreen: false
- IsKeyboardFocusable: true
- HasKeyboardFocus: true
- LegacyIAccessible.Name: "Toolbar"
- LegacyIAccessible.Role: tool bar
- (0x16) LegacyIAccessible.State: focused,focusable (0x100004)
Try using
ByAutomationId
as the search criteria.As an example: