Selector unstable after removing idx in dynamic Angular UI

I’m facing an issue with selector stability in UiPath.

The selector works only when idx is used, but since it’s position-based, it becomes unstable. When I remove idx, the selector either fails or matches multiple elements.

This seems to be related to dynamic UI changes (Angular-based), where the DOM structure is not consistent.

I tried using attributes like innertext and aaname, but still not getting reliable results.

What would be the best approach to handle such cases and build a stable selector?

The issue was due to the page being dynamic, so the selector was changing and idx was acting as a fallback based on position.

To make it more stable, instead of relying on idx , the better approach is to use more reliable attributes such as innertext, aaname, or any unique parent-level attribute if available.

In cases where the selector is still not stable, using an Anchor or re-indicating the target after the menu is opened can help, since the element gets recreated dynamically.

So the fix is:

  • avoid idx as much as possible
  • use stable text-based or unique attributes
  • if needed, use Anchor / dynamic re-indication for popup content

This worked better for handling the instability.

Hello @Tinku_moni_kalita,

IDX is unstable and shouldn’t be relied upon. But sometimes, when we remove IDX, your automation may fail or identify incorrect elements.

In UI Explorer, look for its parent element attributes. If that doesn’t work, try using an anchor; if not, try using an Image (as a last resort).

Thanks,
Karthik

Hi @Tinku_moni_kalita
try to use anchor‑based selectors with stable attributes like role, type, aria attributes, or nearby fixed labels. Avoid idx and rely on strict filtering plus fuzzy anchor targeting. If still unstable, use UiExplorer to identify a stable parent node and build a hierarchical selector with only static attributes.

Happy Automation

Ya…its working now. Thanks for quick help