【问题标题】:How to convert Automation element in to UITestControl [closed]如何将自动化元素转换为 UITestControl [关闭]
【发布时间】:2016-05-26 01:58:17
【问题描述】:

我遇到了一种情况,我必须使用 Windows UI 自动化元素来识别对象。

我想将此对象转换回 UITestControl,以便我可以使用内置方法,例如 waitforcontrol ready 等。

我该怎么做?

问候,

用户232482

【问题讨论】:

  • 这怎么不清楚?

标签: coded-ui-tests


【解决方案1】:

您可以使用其中一种 UITestControlFactory 方法。使用 UITestControlFactory.FromNativeElement 方法(对象,字符串)。您必须将对象参数中的 UIAutomation 元素和技术名称(例如:“UIA”)传递给 String 方法。更多详细信息,请参阅 MSDN https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.uitesting.uitestcontrolfactory.fromnativeelement.aspx

【讨论】:

  • 谢谢洛基,它成功了
猜你喜欢
  • 2021-07-21
  • 2014-06-30
  • 2016-02-20
  • 2013-01-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-12-06
  • 1970-01-01
相关资源
最近更新 更多