简体   繁体   中英

Hidden control at Coded UI

I am trying to record coded UI for a WPF application. My goal ls to click on button ( Mybutton ).

The problem is that in the application there is another control which in not visible and it lays on top of my button. Each time i'm clicking myButton - the code which the CUIT generates is for the blockingControl.

I have the app code - but have no permissions to change the xaml (I can add my own implementation such "onCrerationAutomationPeer").

Is there a way to write a plug in which will know to recognize that the BlockingCcontrol is not visible - and will not choose it?

我已经发现,如果实现onCrerationAutomationPeer以返回null,则将忽略阻塞控件。

在WPF中,您还可以询问按钮是否已启用。

if(button.GetProperty("Enabled").Equals(true)) { ... }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM