Ranorex找不到WPF扩展器的自动化ID

问题描述 投票:0回答:1

我已经定义了一个WPF扩展器,其自动化ID类似于:

<Expander AutomationProperties.AutomationId="MyExpander">

Ranorex间谍没有找到自动化ID,而是将其显示为:

/form[@automationid='MainForm']/container[@automationid='MainGrid']//button[@automationid='HeaderSite']

[不知道为什么Ranorex间谍无法找到“ MyExpander”自动化ID,因为在Ranorex间谍中正确显示了扩展器中单选按钮等的其他已定义自动化ID。

我正在使用Ranorex Spy 8.1.2。

wpf ranorex
1个回答
0
投票

我找到了一个解决方案,虽然效果不太好。

我可以在扩展器中找到单选按钮等的自动化ID,该ID会下降两层,因此上升如下:

var expander = MyRadioButton.Parent.Parent

然后在WPF扩展器将打开的那个元素上执行QuickClick()。

© www.soinside.com 2019 - 2024. All rights reserved.