Trouble replaying recording module for buttons with tooltips

Ranorex Spy, Recorder, and Studio.
rbell
Posts: 4
Joined: Thu Jul 04, 2019 2:49 am

Trouble replaying recording module for buttons with tooltips

Post by rbell » Thu Jul 04, 2019 3:02 am

Hi,

I have some buttons in my AUT that will display tooltips on mouseover. When creating a recorded module, I will click the button and perform subsequent steps, however, when replaying this module, the button cannot be found.

When I use Ranorex Spy to check the path, the button element has been replaced by a tooltip element. Since the tooltip isn't present when replaying the module, the module fails.

Here's what Spy looks like when capturing the button:
Ranorex-ButtonAllocate.PNG
Ranorex-ButtonAllocate.PNG (32.75 KiB) Viewed 103 times
And here's what it looks like when I go back in to see why I can't find the button:
Ranorex-ButtonAllocate-Tooltip.PNG
Ranorex-ButtonAllocate-Tooltip.PNG (34.96 KiB) Viewed 95 times
My AUT has a lot of buttons with tooltips, and this is causing me a problem with writing test cases. I've attached snapshots for both the button and the tooltip captures.

If someone could let me know if I'm doing something wrong, or how to get around this problem, that would be great.
Attachments
Ranorex Snapshots.7z
(1005.96 KiB) Downloaded 4 times
Last edited by rbell on Fri Jul 05, 2019 1:23 am, edited 1 time in total.

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

Re: Trouble replaying recording module for buttons with tooltips

Post by odklizec » Thu Jul 04, 2019 2:37 pm

Hi,

Please upload a Ranorex snapshot of the AUT and failing xpath (as you have it stored in repository). Screenshot is unfortunately useless for UI evaluation. Ideally, please post also the snapshot with displayed tooltip. You can use Instant Tracking feature (see user guide) to capture the tooltip element.
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

rbell
Posts: 4
Joined: Thu Jul 04, 2019 2:49 am

Re: Trouble replaying recording module for buttons with tooltips

Post by rbell » Fri Jul 05, 2019 1:24 am

Edited to attach the snapshot file - not sure why it didn't upload on original submission.

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

Re: Trouble replaying recording module for buttons with tooltips

Post by odklizec » Fri Jul 05, 2019 8:31 am

Please post also the failing xpath, as you have it stored in repository. Thanks.
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

rbell
Posts: 4
Joined: Thu Jul 04, 2019 2:49 am

Re: Trouble replaying recording module for buttons with tooltips

Post by rbell » Mon Jul 08, 2019 1:48 am

Failing path is:
'container[@controlname='uiBackground']//container[@controlname='gbBackground']/?/?/[email protected]='uiTabPageStockAllocation']/?/?/element[@controlname='LeftRebar2']/?/?/[email protected]='CommandBarTools']/button[@accessiblename='Allocate']'

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

Re: Trouble replaying recording module for buttons with tooltips

Post by odklizec » Mon Jul 08, 2019 8:24 am

Hi,

Well, this is really weird. It really looks as if tooltip replaces the button? But if the xpath is corrected, it points to the toolbar button, despite it identifies itself as tooltip? :) Here is the xpath, which should work both with button and tooltip. At least, it finds the 'button' :D The question is, if click on such 'tooltip-like-button' element, will work like click on standard button? Just give it a try...
/form[@controlname='DataForm']//form[@controlname='DataForm']/container[@controlname='uiBackground']//container[@controlname='gbBackground']/?/?/container[@controlname='uiTabPageStockAllocation']/?/?/element[@controlname='LeftRebar2']/?/?/toolbar[@accessiblename='CommandBarTools']/*[@accessiblename~'Allocate']
Anyway, I think it's something caused by Janus UI CommandBar, used in your app, rather than Ranorex bug? But you should definitely try to update somewhat buggy 9.0.0, you are using now, with much more stable 9.1.0! And if 9.1.0 behaves the same, I would suggest to contact Ranorex support (via support form) and provide them with your app, or a small sample app, featuring such toolbar. They may either find what's wrong in Ranorex or confirm a problem with Janus UI component.
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

rbell
Posts: 4
Joined: Thu Jul 04, 2019 2:49 am

Re: Trouble replaying recording module for buttons with tooltips

Post by rbell » Mon Jul 08, 2019 9:46 am

Thanks very much for your reply! The updated path you posted worked. It does appear that the tooltip acts like a button, which is weird!

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

Re: Trouble replaying recording module for buttons with tooltips

Post by Support Team » Fri Jul 12, 2019 6:48 pm

Hi everyone,

The customer did make a support ticket on this issue which I have paraphrased my findings below in case someone else encounters this issue.
Since this element has an MSAA accessibility layer, Ranorex utilizes this for object recognition via our MSAA plugin. To troubleshoot this issue, I used an application called Inspect.exe. This is a debug tool created by Microsoft to read MSAA attributes on elements, similar to Ranorex’s MSAA plugin.

Using Inspect.exe, we see the same behavior, which confirms this is an issue with the Janus element changing the MSAA element type to a tooltip and not back to a button when the tooltip disappears. I recommend filing a bug with the developers of this element to correct this behavior. I have also linked Inspect.exe below if you wish to verify this in your environment as well.

Inspect.exe - Before showing tooltip:
0.png
0.png (7.92 KiB) Viewed 25 times
Inspect.exe - After showing tooltip (but no longer showing tooltip):
1.png
1.png (7.97 KiB) Viewed 25 times
Inspect.exe: https://upload.ranorex.com/s/ae63Ej8cjNgiw7P
2.png
2.png (3.67 KiB) Viewed 25 times
Since this is an issue with the Janus element, we can only work around this issue on our end. The RxPath provided by Pavel in the forums is the best workaround available at this time (copied below). This RxPath will work no matter the element type as long as the accessiblename always contains ‘Allocate’ for both the button and the tooltip element.

./toolbar[@accessiblename='CommandBarTools']/*[@accessiblename~'Allocate']
Cheers,
Ned
.
Image