Hi,
I'm trying to get the row count of the table(datagrid) in a desktop application but it always returns zero. What are the possible issue here?
Here's my code:
Dim repo As DPSRepository = DPSRepository.Instance
Dim previewGrid As Ranorex.Table = repo.TestHarnessMainWindow1.PreviewGrid
msgbox(previewGrid.Rows.Count)
Ranorex version: 5.4.2
.NET Runtime Version: 4
OS: Windows 7 Professional Service Pack 1
AUT: .NET-based desktop application
Please see attached screenshot of the repository properties.
Thanks in advance.
Cannot get data from table(datagrid) in desktop app
-
- Posts: 4
- Joined: Thu Oct 15, 2015 10:09 am
Cannot get data from table(datagrid) in desktop app
You do not have the required permissions to view the files attached to this post.
Re: Cannot get data from table(datagrid) in desktop app
Hi,
Could you please post a Ranorex snapshot of the element in question? Screenshot is unfortunately not helpful here. You can find how to create one here...
http://www.ranorex.com/support/user-gui ... files.html
Could you please post a Ranorex snapshot of the element in question? Screenshot is unfortunately not helpful here. You can find how to create one here...
http://www.ranorex.com/support/user-gui ... files.html
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 4
- Joined: Thu Oct 15, 2015 10:09 am
Re: Cannot get data from table(datagrid) in desktop app
Please see attached snapshot.
You do not have the required permissions to view the files attached to this post.
Re: Cannot get data from table(datagrid) in desktop app
Hi,
It seems to me that you are using old UIA plugin? This is probably why there are no cells recognized by Ranorex? UIA method of recognition is old and recommended to use only in case the WPF Preferred/Only (native WPF plugin) fails to recognize some WPF elements.
Please try to enable WPF Preferred (or WPF Only) in Ranorex Global Settings (follow my post here...
http://www.ranorex.com/forum/how-do-i-e ... tml#p34821). This should greatly improve Ranorex WPF recognition capabilities. Hope this helps?
It seems to me that you are using old UIA plugin? This is probably why there are no cells recognized by Ranorex? UIA method of recognition is old and recommended to use only in case the WPF Preferred/Only (native WPF plugin) fails to recognize some WPF elements.
Please try to enable WPF Preferred (or WPF Only) in Ranorex Global Settings (follow my post here...
http://www.ranorex.com/forum/how-do-i-e ... tml#p34821). This should greatly improve Ranorex WPF recognition capabilities. Hope this helps?

Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 4
- Joined: Thu Oct 15, 2015 10:09 am
Re: Cannot get data from table(datagrid) in desktop app
Thanks for your response. But when I already changed the Global Settings, the table cell values are being identified as Element (Please see attached snapshot). How can I retrieve the table values if this is the case? Thanks in advance.
You do not have the required permissions to view the files attached to this post.
Re: Cannot get data from table(datagrid) in desktop app
Hi,
Unfortunately, it looks as the elements does not display their content? And generally, grid as such does not appear to be identified very well with WPF Plugin?
What else you can try is to set "Realize Items in Virtualizing Containers" and "Show all elements" to true, as described here:
http://www.ranorex.com/forum/unable-to- ... tml#p33791
If it does not help, let these options enabled and try UIA Only instead of WPF Preferred. Just follow some other suggestions from the above post.
The last thing you can try is GDI Capture List, as described here:
http://www.ranorex.com/support/user-gui ... tions.html
Unfortunately, It's useful mainly for simple elements. Using it for large grids is not very comfortable and reliable solution.
Unfortunately, it looks as the elements does not display their content? And generally, grid as such does not appear to be identified very well with WPF Plugin?
What else you can try is to set "Realize Items in Virtualizing Containers" and "Show all elements" to true, as described here:
http://www.ranorex.com/forum/unable-to- ... tml#p33791
If it does not help, let these options enabled and try UIA Only instead of WPF Preferred. Just follow some other suggestions from the above post.
The last thing you can try is GDI Capture List, as described here:
http://www.ranorex.com/support/user-gui ... tions.html
Unfortunately, It's useful mainly for simple elements. Using it for large grids is not very comfortable and reliable solution.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration