Just putting this out there that I found this great little opensource program for Windows to get your x,y coordinates for your XClick in desktop automation. It’s a good compliment to UIVision. The great thing about it is it will give your both the physical x,y and the scaled x,y coordinates. Great for those high DPI monitors:
Thanks, this is very useful! The only problem is that it is Windows only. If someone knows a similar program for Mac, please let us know.
Just to answer my own question:
-
Windows: MPos (as suggested above by @User9898) or MousePosition both work well. MPos shows additional info like screen DPI. MousePosition is faster and has a cleaner UI.
-
For Mac, one can simply use the built-in screenshot tool (Shortcut: CMD+SHIFT+4). It shows a cursor with the x/y coordinates.
-
For Linux, we use
xdotool getmouselocation --shell
Important: XClick|x,y
coordinate systems:
-
In browser automation mode XClick uses relative coordinates, so
XClick | 0,0
refers to the top left corner of the browser viewport (see browser xy tools). -
In desktop automation mode XClick uses desktop coordinates, so
XClick | 0,0
refers to the top left of the main desktop.
If you use an XPath, image or OCR=text with XClick, then UI Vision manages the different coordinate systems automatically. You only need need to keep it in mind when you manually set x/y.