Ranorex struggles to find elements in a table

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Bobby G.
Posts: 8
Joined: Mon Jun 01, 2020 1:52 pm

Ranorex struggles to find elements in a table

Post by Bobby G. » Mon Jun 01, 2020 2:26 pm

Hi all,

I have a problem with Ranorex failing to detect cells in a table. It just detects the container that the table is in, but nothing inside. The interesting thing is that sometimes Ranorex succeeds and I can see the records inside the table, not as rows and cells, but as elements, which is fine, but I can't seem to find a pattern of why and when it finds the content inside. I am using Ranorex Studio v9.2.1.

I managed to make snapshots of both cases and I am attaching them below.

If anyone has some information about this issue, please share. Thanks in advance.

Regards,
Bobby
Elements_Visible.rxsnp
(170.42 KiB) Downloaded 3 times
Elements_Not_Visible.rxsnp
(187.27 KiB) Downloaded 3 times

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

Re: Ranorex struggles to find elements in a table

Post by odklizec » Tue Jun 02, 2020 7:20 am

Hi,

The answer why the table elements are not recognizable are right in the snapshot you posted (the one which shows incorrect state)...
WPFLegacyLimitation.png
WPFLegacyLimitation.png (149.97 KiB) Viewed 207 times
Just follow the instructions from the warning. And ideally, update Ranorex with most recent 9.3.2. Version 9.2.1 is not obsolete and no longer supported and there were number of fixes introduced between 9.2.1 and 9.3.2.
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

Bobby G.
Posts: 8
Joined: Mon Jun 01, 2020 1:52 pm

Re: Ranorex struggles to find elements in a table

Post by Bobby G. » Tue Jun 02, 2020 11:33 am

Hi odklizec,

Thanks for the fast response!

Well, I couldn't get that warning window to appear, but I had tried all of the options of the WPF plugin. And when set to WpfImprovedOnly, indeed Ranorex detects every element I tried so far. The problem is that the element tree changes as well and the paths to the elements I already have don't work any more, which is not good, because the repository is quite large. So, is there a way I can get Ranorex to work with the UiaOnly option, because, as you saw, sometimes it detects the elements, but it is not stable? Thanks in advance.

Regards,
Bobby

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

Re: Ranorex struggles to find elements in a table

Post by odklizec » Tue Jun 02, 2020 11:40 am

Hi,

Apparently, the table in question simple requires WPFImproved and it was only a pure luck that it worked with UiaOnly option? The only thing that you can probably do is to switch the WPF settings from code to WPFImproved and back to UiaOnly (before and after accessing the table).
Check this post about how to switch WPF plugin from code:
https://www.ranorex.com/forum/live-trac ... 1-s15.html
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

Bobby G.
Posts: 8
Joined: Mon Jun 01, 2020 1:52 pm

Re: Ranorex struggles to find elements in a table

Post by Bobby G. » Tue Jun 02, 2020 3:10 pm

Hi again,

Thanks for the tip, it works when I switch the settings. But, probably I should have checked it earlier, Ranorex detects the cell, but when I look at the elements' attributes, there is no text. I can't find an attribute that contains the cells' content. Which is strange and frustrating, because I checked in some other tables and I can see the text attribute, but in this particular one... I am attaching a snapshot, if you have any ideas. Thanks again.
Element_With_No_Value.rxsnp
(3.4 MiB) Downloaded 9 times

User avatar
mayo
Posts: 22
Joined: Fri Dec 28, 2018 7:42 pm

Re: Ranorex struggles to find elements in a table

Post by mayo » Thu Jun 04, 2020 2:46 pm

Hello Bobby,

You mentioned you were successful with other tables within your application, I'm curious as to how they compare to this one. Would you be able to provide a snapshot of a working table in your AUT? I also don't think there was anything specific towards WPF in Ranorex 9.3 but I do recommend updating to the latest version as well.

Regards,

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

Re: Ranorex struggles to find elements in a table

Post by odklizec » Thu Jun 04, 2020 2:57 pm

Hi,

There are two possibilities...
A) Ranorex implementation of WPF is not optimized with this particular DevExpress Table control
B) This DevExpress Table control is not implemented properly and therefore, Ranorex cannot read its values.

As for A), have you tried to enable/switch WPF options in Ranorex settings (Plugins tab)?

In any case, you should contact Ranorex support and request a remote session so they can see and analyze the problem directly on your machine. I'm afraid, they will most probably need access to your app or a sample app, featuring this particular DevExpress table control.

BTW, the only other thing which you might try, is to enable GDI Capture for this table. But as mentioned many times before, the results from GDI Capture are pretty hard to work with, especially with complex elements like tables. So while it might return you some useful values, it may be a nightmare to work with these values ;)
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

Bobby G.
Posts: 8
Joined: Mon Jun 01, 2020 1:52 pm

Re: Ranorex struggles to find elements in a table

Post by Bobby G. » Fri Jun 05, 2020 12:26 pm

Hi all,

mayo - I tried two other tables, but couldn't get the cell content either. I can't remember, in which table I could get it, but I'll keep trying and I'll upload a snapshot, when I do get it.

odklizec - I use the WpfImprovedOnly option when I'm trying to get the cells' value, otherwise, using UiaOnly Ranorex can't detect the cell at all. In relation to that, I have another question:
pic1.jpg
pic1.jpg (179.44 KiB) Viewed 161 times
By using this dynamic action of the element, I am able to extract the cells' content. How can I use this dynamic action in my code? I read in another thread that I can do it by using the invoke action method and then convert it to code, but I can't find these options there...

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

Re: Ranorex struggles to find elements in a table

Post by odklizec » Fri Jun 05, 2020 12:40 pm

Hi,

Just drag&drop the repo element representing cell in question to recording table. Once you release the mouse, there should appear a context menu with list of available actions. What you are looking for is "Invoke Action". Then if you right click the action in recording table, you can convert it to user 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

Bobby G.
Posts: 8
Joined: Mon Jun 01, 2020 1:52 pm

Re: Ranorex struggles to find elements in a table

Post by Bobby G. » Fri Jun 05, 2020 1:09 pm

Hi,

Yes, yes, I do that, but I don't have the "GetDisplayText" option there. Here is a screenshot:
pic2.jpg
pic2.jpg (34 KiB) Viewed 158 times

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

Re: Ranorex struggles to find elements in a table

Post by odklizec » Fri Jun 05, 2020 1:17 pm

Hi,

Unfortunately, if the command is not there, it's most probably not implemented in the UI. It seems that you are out of luck here? Have you tried GDI Capture apporach?

I think your best option is to contact Ranorex support. But I don't think there is a quick or immediate solution for this problem.
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

Bobby G.
Posts: 8
Joined: Mon Jun 01, 2020 1:52 pm

Re: Ranorex struggles to find elements in a table

Post by Bobby G. » Fri Jun 05, 2020 1:22 pm

Hi,

Tough luck for me then.

As far as for GDI, I am not sure how it works exactly. I read the user guide about that, but couldn't quite get it to work...

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

Re: Ranorex struggles to find elements in a table

Post by odklizec » Fri Jun 05, 2020 1:28 pm

Hi,

Well, GDI Capture is not always helpful, but usually, it returns number of RAWTexts from pointed UI elements. Have you tried to add Table element to GDI Capture list? Once its added and Spy is refreshed, there should appear list of RAWTexts, in which you may find the cell you are looking for.
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

Bobby G.
Posts: 8
Joined: Mon Jun 01, 2020 1:52 pm

Re: Ranorex struggles to find elements in a table

Post by Bobby G. » Fri Jun 05, 2020 1:48 pm

Hi,

I try to add the table element to the GDI capture list, like it is explained in the user guide, but I don't have that option.
pic3.jpg
pic3.jpg (170.73 KiB) Viewed 155 times

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

Re: Ranorex struggles to find elements in a table

Post by odklizec » Fri Jun 05, 2020 2:26 pm

Hi,

In this case, examine all parent containers. I guess there will be such option in Element MasterData...?
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