Page 1 of 1

Unable to recognize grids

Posted: Thu Apr 21, 2011 7:43 pm
by svnr
Hi,

In out application some grids are used which are not recognized by GDI plug in.We need to read the all cell values of the grid which has scroll bars. Also we need to set values in the grid cells.attached the snapshot of the form/page

Note: for the attached grids TTF16_WndClass grids we are not able to get the info like row values etc using GDI plugin. For VSFlexGrid we are able to get the rowvalues etc but could not read the grid cells when the grid has scrollbars etc. Please suggest way to read the grid like table and able to do operations on it.

Thanks,
SVNR

Re: Unable to recognize grids

Posted: Fri Apr 22, 2011 8:33 am
by Support Team
Hi,
svnr wrote:for the attached grids TTF16_WndClass grids we are not able to get the info like row values etc using GDI plugin
According to your Ranorex Snapshots, Ranorex is able to find every item inside the Grid. For example, with following RxPath you should find the "Subject Header"
/form[@title~'^Choose\ Study\ Samples\ for\ ']/element/element/element/element/element/element/rawtext[@rawtext=' Subject ']
svnr wrote:For VSFlexGrid we are able to get the rowvalues etc but could not read the grid cells when the grid has scrollbars etc.
You have to scroll manually and then read the grid again. The RawText Plug-In forces your application to redraw and catch the text elements. Therefore you can't access values with the RawText Plug-in, which are not visible on the screen. The same behavior is valid for minimized applications.

Regards,
Peter
Ranorex Team

Re: Unable to recognize grids

Posted: Fri Apr 22, 2011 4:12 pm
by svnr
Thanks for the information. using x path of the known items we can identify the rawtext(cell value) how ever in our application we need to read all the cell values of the grid. We tried by trying to read all rows or columns or decendants for TTF16.WndClass grids. Can you please let us know how to get the table values for this grid.

Thanks,
SVNR

Re: Unable to recognize grids

Posted: Fri Apr 22, 2011 4:33 pm
by Support Team
When you track the cells with Ranorex Spy, you will see that the "RawText property contains the text value. So in your code you just have to use that property, e.g.:
Ranorex.Unknown ttf16 = @"/form[@title~'^Choose\ Study\ Samples:\ Sel']/element/element/element[@class='TTF16.WndClass']";
foreach (Ranorex.RawText rawTextElement in ttf16.FindDescendants<Ranorex.RawText>())
    string text = rawTextElement.RawTextValue;
Regards,
Alex
Ranorex Team

Re: Unable to recognize grids

Posted: Mon Apr 25, 2011 7:50 pm
by svnr
Thank you for the help. We have tried the same way but always getting decendants count as '0'. Also our requirement is to get the table values of the grid. The grids are related to F1Book(TTF16.ocx grids from Formula One i.e VB grids) Please suggest a way to read/recognize these grids.

Thanks,
SVNR

Re: Unable to recognize grids

Posted: Tue Apr 26, 2011 6:23 pm
by slavikf
If you trying to read data from grid, I think it is better to use attribute, different, then "rawtext". You can use "column" and "row" for example:

…rawtext[@column='5' and @row='3']

Re: Unable to recognize grids

Posted: Wed Apr 27, 2011 10:04 am
by Support Team
Hi,

The code which Alex posted works as expected. Is the form visible on the screen, when you try to get the values? Because the RawText Plug-In needs a visible GUI to redraw the items. Please activate the form before you get the elements with Alex's Code.

Regards,
Peter
Ranorex Team