Not able to get the values of the table cells

Ranorex Spy, Recorder, and Studio.
NishantSingh
Posts: 39
Joined: Thu Oct 09, 2014 1:15 pm
Location: Bangalore

Not able to get the values of the table cells

Post by NishantSingh » Mon Nov 10, 2014 10:24 am

Hi,

I am working on windows application created using .net Framework. In this from a table I want to get the values from a specific cell I have tried with "AccessibleValue' property and "text" property but not able to capture the value. Even I checked in the SPY there is no property listed which have the row value.

I am usingh Ranorex Studio 5.2 in Windows 7 OS.

Attaahing the Table snapshot.
I tried to capture the "Last Name" column cell value.

Please help me out

Regards,
Nishant Singh.
Attachments
TableSnapshot.rxsnp
(396.97 KiB) Downloaded 75 times
Regrads,
Nishant Singh

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

Re: Not able to get the values of the table cells

Post by odklizec » Mon Nov 10, 2014 2:02 pm

Hi,

The problem is, that the cell in question does not have correctly set (user friendly) accessibility. The text you are looking for is a part of AccessibilityDescription string...
TelerikCell.png
TelerikCell.png (164.23 KiB) Viewed 657 times
I think the "simplest" way how to extract this text is probably by using regular expression. This regex should return the last name from the pointed cell:

Code: Select all

^Telerik.WinControls.UI.GridViewCellInfo ;(.*?);
I'm not so skilled in regex, so there may be an even better/safer regex to extract the text. But this one should work just fine? ;)

Now to get the text for further manipulation by GetValue action:
GetValue.png
GetValue.png (11.4 KiB) Viewed 657 times
Hope this helps?

BTW, I would also suggest to kindly ask your dev guys to implement AccessibilityValue/Text for given table cells. There is almost always a way around the missing/incomplete/ugly implemented accessibility values, but it would save you a lot of time if they are done properly ;)
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

NishantSingh
Posts: 39
Joined: Thu Oct 09, 2014 1:15 pm
Location: Bangalore

Re: Not able to get the values of the table cells

Post by NishantSingh » Tue Nov 11, 2014 7:28 am

Hi odklizec,

Thanks a lot, you code is working fine.

Regards,
Nishant Singh
Regrads,
Nishant Singh