Spy finding wrong button

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
bhoppe
Posts: 14
Joined: Thu Sep 08, 2011 10:34 pm

Spy finding wrong button

Post by bhoppe » Mon Oct 13, 2014 5:34 pm

How can I force Ranorex to find an exact button? I have several Flex buttons in a navigation pane across the top of the page. When a particular button exists, it finds it just fine using highlight element.

When a button does not exists, the highlight element finds a different button in the pane which is incorrect. I can't figure out how to get Ranorex to fail to find a button when it doesn't exists.

This is the path to the button I'm working with:
/dom[@domain='zzz.com']/body/div/flexobject/container/toolbar[@id='headerBar']/
container/container[@id='navigator_M']/container[@id='hbNavButtonBar']/
container[@id='hbNavButtons']/container[@id='vbBtnElectricalSim']/button[@id='btnElectrical'']

When the button does not exist, it highlights this button instead:
/dom[@domain='zzz.com']/body/div/flexobject/container/toolbar[@id='headerBar']/
container/container[@id='navigator_M']/container[@id='hbNavButtonBar']/
container[@id='hbNavButtons']/container[@id='vbBtnThermalSim']/button[@id='btnThermal']

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Spy finding wrong button

Post by Support Team » Wed Oct 15, 2014 4:07 pm

Hello bhoppe,

I’m afraid that Ranorex won’t find the actual element, but the best matching element. Please check if you can see following warning within the Ranorex Spy:
BestMatch.png
Does Ranorex idendify the button correctly when replaying the test?

Regards,
Robert
You do not have the required permissions to view the files attached to this post.