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.