data grid - ranorex spy unable to click individual items

Ask general questions here.
neeshpal
Posts: 10
Joined: Tue Jun 11, 2019 6:29 pm

data grid - ranorex spy unable to click individual items

Post by neeshpal » Thu Jun 27, 2019 1:56 pm

Hello
My app is desktop app where UI is built in C++. I have a window and inside that window there is a grid and there's data in that grid. Ranorex can find window. But spy is unable to click on each grid item. When I try it , it just gives me back the main window and not individual items.

I see in the tree structure on left hand side on spy that there is a List item under this main window but there is only one level of hierarchy in which there are three more items (2 ListItem and one ScrollBar) and thats it.

Question: Give this scenario , is it possible to get to the grid programmatically even if spy couldn't click on individual grid items? If yes how can we achieve this? If no, are there any options to try?

Thank You

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

Re: data grid - ranorex spy unable to click individual items

Post by odklizec » Thu Jun 27, 2019 8:07 pm

Hi,

Without seeing your app or, at very least, Ranorex snapshot (NOT screenshot), it’s impossible to tell anything definitive. But from my experience with such unrecognisable elements, your best hope is most probably GDI capture feature (check this user guide chapter). In other words, there is most probably no other way to obtain data from such element, unless someone implements proper accessibility to tested data grid.
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

neeshpal
Posts: 10
Joined: Tue Jun 11, 2019 6:29 pm

Re: data grid - ranorex spy unable to click individual items

Post by neeshpal » Fri Oct 18, 2019 8:04 pm

Thank You for your reply. I tried GDI capture feature , but it is still not recognizing the grid.
Are there any other options that I can try ?

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

Re: data grid - ranorex spy unable to click individual items

Post by odklizec » Mon Oct 21, 2019 9:02 am

Hi,

I'm afraid, if GDI is not working for you, there is most probably nothing you can do about this. The only other option could be adding proper accessibility support to your app/grid. But it could be somewhat tricky (maybe even impossible) if you have no access to grid's source code.
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

neeshpal
Posts: 10
Joined: Tue Jun 11, 2019 6:29 pm

Re: data grid - ranorex spy unable to click individual items

Post by neeshpal » Mon Oct 21, 2019 2:55 pm

Actually, when I use 32 bit ranorex spy, GDI is recognizing the grid and gives me an xpath with

Code: Select all

@rawtext
in it. This should do it.
Thank You for mentioning that feature.

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

Re: data grid - ranorex spy unable to click individual items

Post by odklizec » Mon Oct 21, 2019 3:02 pm

Hi,

Good to hear that! Rawtext is exactly what GDI capture returns and it usually works as a last resort. It's not easy to work with rawtexts in very complex UI elements (like grids), but it's better than nothing ;)
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

neeshpal
Posts: 10
Joined: Tue Jun 11, 2019 6:29 pm

Re: data grid - ranorex spy unable to click individual items

Post by neeshpal » Thu Oct 24, 2019 8:36 pm

Hello
Using spy, I can recognize element but I am unable to find element when trying through code (VS) . xpath that I get from spy is same as xpath that code is trying

Code: Select all

/form[@title='ClassName']/element[@class='ClassName' and @instance='0']//rawtext[@rawtext='10/24/19 15:02:11']
I also turned on RawText feature like this

Code: Select all

          var plugins = Ranorex.Core.PluginManager.Instance;
            plugins.LoadDefaultPlugins();
            RawTextFlavor.Instance.ClassNames.Add(new Regex("ClassName"));
            RawTextFlavor.Instance.UpdateFromConfig();
Do you see anything missing? how can I make it work ?