Teststack.white cannot find Toolstrip item

1.1k views Asked by At

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)
1

There are 1 answers

1
Nicole On

Try using ByAutomationId as the search criteria.

As an example:

ToolStrip toolStrip = StartApplication.Window.Get<ToolStrip>(SearchCriteria.ByAutomationId("Toolbar"));