Spy Clicks through all buttons on page

Ranorex Spy, Recorder, and Studio.
DevinderSodhi
Posts: 6
Joined: Fri Jul 07, 2017 8:09 pm

Spy Clicks through all buttons on page

Post by DevinderSodhi » Mon Oct 02, 2017 6:51 pm

Hello,

I have an application which has a settings page. When i try to click any one item on the page via ranorex spy or the studio spy tool, every single element on the page gets clicked, and then a few behind it on a different tab (its a tab page). I m not sure what's going on here, but would love to hear a solution. All the individual buttons get recognized by spy, but clicking any of them clicks every item on the page.

I have attached a snapshot and would appreciate any resolutions to the matter.

Best regards,
Devinder
Attachments
allbuttonsarepressed.rxsnp
(95.31 KiB) Downloaded 22 times

jma
Posts: 111
Joined: Fri Jul 03, 2015 9:18 am

Re: Spy Clicks through all buttons on page

Post by jma » Tue Oct 03, 2017 9:57 am

Hi Devinder,

Could you explain in more detail what it means that every item from the application is clicked? Do you mean that the wrong item is clicked or that all items are clicked simultaneously?

Probably, it would be helpful to illustrate the issue by creating a screencast (for example with https://screencast-o-matic.com/). Furthermore please create a compressed Ranorex Report of the failed test execution.

Do you experience this issue when clicking specific UI elements or really with every UI element in the SUT? If it only concerns specific UI elements, let us know the RanoreXPaths of those elements.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Spy Clicks through all buttons on page

Post by krstcs » Tue Oct 03, 2017 2:20 pm

My guess would be that your developers decided to use one OnClick handler method to handle ALL clicks on the page, instead of doing an OnClick handler for each clickable element. When Ranorex does the Click action from Spy, it is probably triggering the OnClick event, but the handler isn't called correctly because Ranorex doesn't know about your page's mechanisms.
Shortcuts usually aren't...

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

Re: Spy Clicks through all buttons on page

Post by odklizec » Tue Oct 03, 2017 2:30 pm

Hi,

There is definitely something weird about the AUT or the way Ranorex recognizes its elements. It's very well visible in the attached snapshot. Many elements have incorrect screenshots as if covered by something else. Eventually, the element rectangles are taken with offset. At first, I would suggest to examine display scaling. Just make sure it's set to 100% (max 125%).
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

DavidHay
Posts: 19
Joined: Wed Aug 30, 2017 7:58 pm

Re: Spy Clicks through all buttons on page

Post by DavidHay » Tue Oct 03, 2017 3:37 pm

I work beside Devinder and watched the strange behavior. jma, when Ranorex clicks on one element, all the check boxes get checked simultaneously. A popup also appears. The popup is actually activated from a different tab from the element. I think your guess is a good one krstcs. Devinder is back at work tomorrow and will follow up with more information. This is an older application and the first time automation has been attempted on this screen so I suppose strange behavior is expected.

Thanks
David

DavidHay
Posts: 19
Joined: Wed Aug 30, 2017 7:58 pm

Re: Spy Clicks through all buttons on page

Post by DavidHay » Wed Oct 04, 2017 1:51 pm

Solved. The behavior was being caused by the use of the optional (?) path element. ?/?/button[@text='Left Face'] triggered the strange behavior. Using .//button[@text='Left Face'] instead fixed the problem. Somehow Ranorex must have triggered the event or events when it was querying the optional path.

David

DevinderSodhi
Posts: 6
Joined: Fri Jul 07, 2017 8:09 pm

Re: Spy Clicks through all buttons on page

Post by DevinderSodhi » Wed Oct 04, 2017 2:41 pm

Thank you all for the replies. I apologize for not responding right away, was out of work.

I think David was able to solve the issue yesterday, and listed it above.

Thank you all.

side note responses:

jma: it was clicking all items on the tab page, i guess its solved for now but i can show if you want.
krstcs: this was not the issue, but i think its a feasible idea and a good one to keep in the back of my mind.
oklizec: its curious, because even now when we select the item at all in the spy tool, everything automatically gets clicked. Ranorex seems to be doing some verification or traversal behind the scenes, i would love to read up on some literature describing how it works. The scaling however, was not the issue, the pathing was, somehow