Coded UI Test Finding Controls On Expanded Row

一世执手 提交于 2019-12-12 04:38:17

问题


I'm trying to write some coded ui tests for a WPF application and have gotten to part of the application that contains a datagrid with collapsing and expanding rows.

I am able to find and interact with controls on the collapsed rows fine using hand-coded tests but haven't had any luck finding any of the controls in the expanded part of the row. Using the crosshairs on such a control shows the item to be under UIItemRow, UIItemCustom (class name Uia.DataGridDetailsPresenter), and then the target control. I'm not sure on how to tell the tests to search to find these controls.


回答1:


Maybe its caused by the vertical virtualization. In any case, try this Snoop

It is a must have for any WPF developer. Most likely in situation when you are traversing through the visual tree.




回答2:


In the UITest file check the Search Properties and Filter Properties, I'm not sure your exact problem but it usually fixes problems with searching for controls.



来源:https://stackoverflow.com/questions/17755252/coded-ui-test-finding-controls-on-expanded-row

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!