Spy shows 2 elements found but only highlighted 1

Ask general questions here.
monkey2012
Posts: 77
Joined: Wed Sep 26, 2012 8:15 pm

Spy shows 2 elements found but only highlighted 1

Post by monkey2012 » Wed Aug 21, 2013 5:18 pm

This is Ranorex 4.1.0

I have seen that in my project, Spy displayed 2 elements found for a particular RxPath, when I used the Highlight feature, only 1 element is highlighted.

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Spy shows 2 elements found but only highlighted 1

Post by Ciege » Wed Aug 21, 2013 5:20 pm

Is one of them hidden or set to visible=false?
Maybe off page or in a hidden container?
Etc...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

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

Re: Spy shows 2 elements found but only highlighted 1

Post by krstcs » Wed Aug 21, 2013 6:17 pm

The "Highlight Element" action only highlights the FIRST matching element.

Before 4.1.0, there was a way in the path editor to highlight all elements that matched the given RXPath, but that was part of the path editor functionality that was removed in favor of the new Spy functionality.

If you click the "Edit..." button next to the repository object in your Object Repository, it will open spy to that object's path in the "Path Editor" tab. You can click on the "Browser & Results" tab and it will show you all elements that match that path, where you can highlight each one individually.

There is no longer a way to highlight all matching elements at the same time.

I'm not sure I like the changes to the path editor myself, but it may just be that it was what I was used to.
Shortcuts usually aren't...

monkey2012
Posts: 77
Joined: Wed Sep 26, 2012 8:15 pm

Re: Spy shows 2 elements found but only highlighted 1

Post by monkey2012 » Wed Aug 21, 2013 7:25 pm

I just tried what krstcs suggested.
Click on the Browser & Results tab, the hierachy shows:
Widget
| |_ text1
|_text1

Both "text1" highlighted the same element on my application

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

Re: Spy shows 2 elements found but only highlighted 1

Post by krstcs » Thu Aug 22, 2013 7:00 pm

OK, I have to retract part of my earlier statement.

Ranorex Spy will highlight multiple matching elements at the same time, if you are in the "Path Editor" tab. The first one found will be highlighted in RED, the others will be ORANGE.

At this point I think your issue might be related to what Ciege suggested about the element or a parent not being visible, or off the screen.
Shortcuts usually aren't...

User avatar
HD_Jim
Posts: 4
Joined: Fri Aug 23, 2013 1:26 am

Re: Spy shows 2 elements found but only highlighted 1

Post by HD_Jim » Fri Aug 23, 2013 1:43 am

Yes definately agree with ciege and krstcs, there will be a hidden object of the same path you have specified. They may even be overlayed in the same location - one is displayed under certain circumstances etc. MS Dynamics AX is full of these, I use them to my advantage, at times a panel is collapsed and highlights just the collapsed section, when expanded it shows the two sections as two objects of the same description, we just use the one path for both, and it grabs the objects we need (children are different) without the tester having to understand there are two objects.
Jim Donovan
Test Automation Manager

Sime Darby Industrial