【问题标题】:Teststack.white cannot find Toolstrip itemTeststack.white 找不到工具条项目
【发布时间】:2015-08-23 08:20:38
【问题描述】:

当我尝试获取工具条元素时

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

出现此错误:

错误:无法获取 ControlType=tool bar,Name=Toolbar

工具栏属性是:

  • 名称:“工具栏”
  • ControlType:UIA_ToolBarControlTypeId (0xC365)
  • Lo​​calizedControlType:“工具栏”
  • IsEnabled:真
  • IsOffscreen: 假
  • IsKeyboardFocusable: true
  • HasKeyboardFocus: true
  • LegacyIAccessible.Name:“工具栏”
  • LegacyIAccessible.Role:工具栏
  • (0x16) LegacyIAccessible.State:focusable,focusable (0x100004)

【问题讨论】:

  • 看来问题出在错误的控制类型上,我遇到了“窗格”控制类型的问题,它被检查为“窗格”,但我应该使用“GroupBox”类型来与 teststack 一起使用。
  • 这是一个 Infragistics.Win.UltraWinToolbars.UltraToolbar 我怎样才能得到它?

标签: automated-tests white-framework


【解决方案1】:

尝试使用ByAutomationId 作为搜索条件。

举个例子:

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

【讨论】:

  • 问题是这个元素有 Infragistics.Win.UltraWinToolbars.UltraToolbar 类型,我仍然没有机会得到它。你有什么想法吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-04-27
  • 1970-01-01
  • 2018-02-21
  • 1970-01-01
  • 1970-01-01
  • 2015-09-18
  • 2017-02-01
相关资源
最近更新 更多