Easy way to find x y coordinates on MonkeyRunner

user182192 picture user182192 · Jul 19, 2012 · Viewed 10k times · Source

I am using MonkeyRunner to test my very broad application and running many different scripts on my devices. However it is taking a long time to figure out where the x/y coordinates are on every touch of the screen. I tried using this nice plugin http://blogs.wittwer.fr/whiler/2011/07/01/editeur-monkeyrunner/ but its coordinates are not accurate enough....Is there any app I can install that will give me a toast for the coordinates I need?

device.touch(225, 182, "DOWN_AND_UP")

Answer

Diego Torres Milano picture Diego Torres Milano · Jul 20, 2012

The coordinates of every touch can be obtained using Settings -> Developer options -> Pointer location, but perhaps you don't need the coordinates at all. Take a look at http://dtmilano.blogspot.ca/2012/05/androidviewclient-q.html which describes how you can use View IDs to obtain coordinates and send events.