Getting full contents of a Datagrid using UIAutomation

后端 未结 2 1362
星月不相逢
星月不相逢 2021-01-14 13:09

I have need to retrieve all of the items in a Datagrid from an external application using UIAutomation. Currently, I can only retrieve (and view in UISpy) the visible items.

相关标签:
2条回答
  • 2021-01-14 13:32

    I am 99% sure that this is not possible. UI Automation doesn't know about the data structures which are represented by the currently visible portion of a grid. It only sees what is visible. I think that you will have to page through the grid to get all the data (that is what I do).

    0 讨论(0)
  • 2021-01-14 13:48

    You can only retrieve the visible cells because you have table virtualization on.

    Try disabling the virtualization (not always possible in all application but perhaps you want to move it into configuration and change it before testing)

    0 讨论(0)
提交回复
热议问题