How would I access DataGrid columns by thier names rather than indexes?
Say I have following grid
Name Age Designation
Mike 27 Developer
Louis 32 Manager
I can access the second row's "Age" cloumn value by finding the grid using RxPath and then accesing the rows and columns by indexes. But how would i do that by column names.
If I don't use the cloumn names my test would fail if I change the sequence of cloumns.
DataGrid Columns
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
There is no built-in functionality for that, yet. But you can easily map the column names to indices yourself, e.g. by going through the header row once and storing the column name <-> index relation in a dictionary. Then you can use this mapping when you access a cell und update the mapping whenever the columns are reordered.
Regards,
Alex
Ranorex Support Team
Regards,
Alex
Ranorex Support Team
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria