How to interact with 2 MobileElements with the same name

I need to press the “Operations” element in order to open the operations screen.

The problem i am facing is that there is another element called “Operations”- this element is just a title & not a button & it is display above the operation button i need to click.
So if I attempt to click the “Operations” by name/ID it click the first element which is the title & not the button.

Below is a screenshot of the 2 elements, any idea how can I identify the correct element?

You could use xpath: //UIAElement[@name='Operations']

1 Like

However i prefer to avoid the xpath usage.
Is there another approach using ID/Name or something else maybe…

Which client are you using ? (java/python/…)

The java lib.

You can make a list of elements and pick the second:


It’s not the best solution but it will work here. You could also try iOS UI Automator (i don’t know much about it since i use Android).

1 Like

In this case I will ask developer to give unique id for each of the elements.

1 Like