Page 1 of 1

Spy finding wrong button

Posted: Mon Oct 13, 2014 5:34 pm
by bhoppe
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']

Re: Spy finding wrong button

Posted: Wed Oct 15, 2014 4:07 pm
by Support Team
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