Page 1 of 1

Spy Clicks through all buttons on page

Posted: Mon Oct 02, 2017 6:51 pm
by DevinderSodhi
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

Re: Spy Clicks through all buttons on page

Posted: Tue Oct 03, 2017 9:57 am
by jma
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.

Re: Spy Clicks through all buttons on page

Posted: Tue Oct 03, 2017 2:20 pm
by krstcs
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.

Re: Spy Clicks through all buttons on page

Posted: Tue Oct 03, 2017 2:30 pm
by odklizec
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%).

Re: Spy Clicks through all buttons on page

Posted: Tue Oct 03, 2017 3:37 pm
by DavidHay
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

Re: Spy Clicks through all buttons on page

Posted: Wed Oct 04, 2017 1:51 pm
by DavidHay
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

Re: Spy Clicks through all buttons on page

Posted: Wed Oct 04, 2017 2:41 pm
by DevinderSodhi
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