If tracking produces the wrong element, selects a large container instead of the target, or your repository item later fails to find the element, use this checklist to diagnose the most common causes.
Tracked the wrong element
Confirm what Spy sees
In Spy, select the element and use Highlight element to confirm it matches the control you intended.
Refresh UI state
Click Refresh in Spy to update the element tree after UI changes (dialogs opened, lists expanded, etc.).
The element is transient
Use instant tracking (Ctrl + WIN) while the element is visible and in focus.
Your identification is too dynamic
If a locator depends on changing values, make the RanoreXPath more stable by:
- Preferring stable attributes (caption/accessibility-related values when available)
- Using regex for dynamic values when needed
Adjusting attribute weights so volatile attributes are ignored (attributes with a weight < 100 are ignored in path generation)
Spy can’t identify the control correctly
In rare cases (legacy UI tech like VB6, MFC, older Delphi), Ranorex may select a large container instead of the exact element you clicked. In those cases, use GDI capture in Spy to improve identification.
Use GDI capture when:
- Tracking consistently highlights the whole control instead of the clicked sub-element
- Standard identification doesn’t expose the UI structure you need
Your endpoint/automation root is wrong
Make sure Spy is looking at the correct endpoint:
- Standalone Spy can select the automation root using its Endpoints option.
- Integrated Spy uses the endpoint selection from Studio’s Endpoints pad.