I have a scenario where a single page has two similar icons (lets say Search icon).
Both search icon is having same attributes (aaname, innertext etc).
For example, lets assume search icon is present near Name textbox and Address Text box. Now, I want to locate the search icon near address text box. How to differentiate between two icons here?
On indicating, only idx value differs. Is there a way we can specifically locate the icon near address text box without depending on idx value?
use Anchor Base or Find Relative Element activities. Anchor the selector to the Address textbox or its label, then find the icon relative to that anchor.
try with Anchor Base activity ,Set a nearby unique element like the “Address” label or textbox as the anchor. This helps identify the correct icon based on UI layout rather than index.
@shahidhaqeel.s it means the selector is not unique enough. To fix this, use UiExplorer to find a stable, unique parent or sibling attribute near the Address textbox (like a container ID, class, or label text) and include it in the selector along with the anchor try to fine tuning the selectors
If using modern, those already have an option to select the anchor to help identify the element uniquely.
For e.g. click activity would have target as well as anchor in there. Also, the modern activity uses various methods(CV/image/fuzzy/strict) to identify the element properly.
i would suggest to identify element using modern equivalent and then select different anchors for different text boxes, should work.
Use Strict Seletor, Fuzzy selector and Image and add anchor too and check or else try exploring UiExplorer to findout one key property that is different
then in center top window try to move from bottom to top one level at once and check which line talks about the related name or address fields and select that line to make the selector for both searches unique
@shahidhaqeel.s Try providing anchor selection using CV(Image region selection) bcz the selectors are not reliable to identify a specific element it can identify the element using its visual appearance