Datagrid

Best practices, code snippets for common functionality, examples, and guidelines.
IvanT
Posts: 31
Joined: Wed Feb 06, 2019 8:00 pm

Datagrid

Post by IvanT » Mon Dec 23, 2019 9:43 pm

Hello. i need help. i am testing desktop application and i need check table import (grid table). witch is the best way to do it, also i want to use this may times. may be ranorex has methods to save table and then compare (expected table and currenly table)&

User avatar
RobinHood42
Posts: 311
Joined: Fri Jan 09, 2015 3:24 pm

Re: Datagrid

Post by RobinHood42 » Tue Dec 24, 2019 9:45 am

Hi!

This has to be done in user code. You can use the FindChildren() (or FindDescendants()) method to get all child elements from the Grid which can be compared to the expected values in a loop.

Here is an example of how to implement such a loop: How to use FindChildren to loop through a //div

Cheers,
Robin

IvanT
Posts: 31
Joined: Wed Feb 06, 2019 8:00 pm

Re: Datagrid

Post by IvanT » Thu Dec 26, 2019 4:08 pm

Thanks, but can i save current table (for example as snapshot) and use it as expected table?

IvanT
Posts: 31
Joined: Wed Feb 06, 2019 8:00 pm

Re: Datagrid

Post by IvanT » Thu Dec 26, 2019 4:20 pm

Also I have a problem with the data grid when the table is larger than the window.
ranorex identifies 6 rows, if I want to see rows7, I have to scroll down the list. Maybe I can find this item without scrolling. if not, in what way would it be better to find an element to reuse this method
Attachments
Snap.rxsnp
(122.72 KiB) Downloaded 1 time

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 5459
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Datagrid

Post by odklizec » Thu Dec 26, 2019 5:23 pm

Hi,

Sure, you can use a Ranorex snapshot as a reference data file and compare it with actual table. For an example code, check this link...
https://www.ranorex.com/help/latest/han ... ntiretable

However, if the table under question is lazy-loaded (table shows only visible items and invisible items must be scrolled to load them up), this approach will not work. Definitely not without some serious coding.
Pavel Kudrys
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