Bug with Columns Methods?

Bug reports.
djpflug23
Posts: 17
Joined: Fri Apr 15, 2011 9:13 pm

Bug with Columns Methods?

Post by djpflug23 » Fri Jul 22, 2011 3:58 pm

Hi Ranorex,

My team and I have been having some problems when working with tables. We can do pretty much whatever we need to when we use rows, but when we try to do the same kind of thing with methods that look for columns, it isn't finding any columns in the tables. It doesn't matter what table the project is looking at, it doesn't seem to find any columns at all. To test this, we tried a simple project using the following code:
Report.Info(Convert.ToString(repo.FormMaintenance_Process___Up.ContainerPanel11.TablePrtMatDataGrid.Columns.Count));
When we ran this, it gave the attached report (test_20110721_155457.rxlog). I have also attached a snapshot of the table that we ran the test on. Are we using these methods incorrectly? Can they not be used in the same way as the rows methods? Thanks!

Dave
Attachments
ColumnCountTestSnapshot.rxsnp
Snapshot of the table that was used for the test of the Column Count method
(870.25 KiB) Downloaded 152 times
test_20110721_155457.rxlog
Count Column test report
(1.45 KiB) Downloaded 121 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Bug with Columns Methods?

Post by Support Team » Tue Jul 26, 2011 12:54 pm

The Table.Columns just returns all immediate children of the table which role is Column. Consequently, for this property to return a non-empty list, columns need to show up underneath the table element when tracking the table with Ranorex Spy. Please note, that columns are not supported for all technologies.

So, if you do not see any columns underneath your table in Ranorex Spy (as in your snapshot), then the Table.Columns property will always return an empty list; simply because there are no columns to return.

Regards,
Alex
Ranorex Team
.
Image