【发布时间】:2016-05-26 01:58:17
【问题描述】:
我遇到了一种情况,我必须使用 Windows UI 自动化元素来识别对象。
我想将此对象转换回 UITestControl,以便我可以使用内置方法,例如 waitforcontrol ready 等。
我该怎么做?
问候,
用户232482
【问题讨论】:
-
这怎么不清楚?
标签: coded-ui-tests
我遇到了一种情况,我必须使用 Windows UI 自动化元素来识别对象。
我想将此对象转换回 UITestControl,以便我可以使用内置方法,例如 waitforcontrol ready 等。
我该怎么做?
问候,
用户232482
【问题讨论】:
标签: coded-ui-tests
您可以使用其中一种 UITestControlFactory 方法。使用 UITestControlFactory.FromNativeElement 方法(对象,字符串)。您必须将对象参数中的 UIAutomation 元素和技术名称(例如:“UIA”)传递给 String 方法。更多详细信息,请参阅 MSDN https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.uitesting.uitestcontrolfactory.fromnativeelement.aspx
【讨论】: