How to tap a button in UI Automation which has only coordinates?

533 views Asked by At

I only have the coordinates of the button :

UIAButton:rect:{{253,27},{60,30}}

which I have stored in an array. I want to tap this button particularly without giving its coordinates so that it is generic for the remaining buttons.

Thank you.

1

There are 1 answers

0
Ian On BEST ANSWER

I would do something like what is shown in this question.

UIATarget.localTarget().frontMostApp().tapWithOptions({tapCount: 1, tapOffset: {x: 0, y: 0});

You'd replace the zeros in tapOffset with your desired x and y values.