How can we Tap an object that is a duplicate in the same page. (Android Mobile)

Hi, I have a issues that maybe the community here can help. I want to write a script to tap a button inside a page, and I want to tap the same button multiple time inside the same page. I notice that when I spy the objects, all the object do not have any resource-id or anyway that I can differentiate each object from one another. I give an example by this screenshot.

As can see, we have the same card that represent each stock. My script is like I want to click “Buy” for the first stock and then “Sell” for the second. I notice the objects inside the first and second objects is the same with one another. The only different is the x,y axis. How can i write my script to differentiate the objects.

1 Like

Hi there, :wave:

Thank you very much for your topic! It may take a little while before Katalon team member or others forum members respond to you.

In the meantime, you can double-check your post to see if you can add any extra information i.e. error logs, HTML codes, screenshots, etc. Check out this posting guide to help us help you better!

Thanks! :sunglasses:
Katalon Community team

You might try to indicate that the object is the second item by using an index, like:
.../android.view.ViewGroup[2]
or
(.../android.view.ViewGroup)[2]

Mobile Automation | Lesson 12 | Handle multiple matched elements (youtube.com)