Calculate web element position and click on it in Chrome

I've gotten good use out of the Click on Chrome Item by Xpath, but found it doesn't work everywhere - some web apps (notably Google Docs) seem to require a true mouse click event.

I needed to add a gray border to a ton of images in Google Docs, so I made this macro which calculates an web element's position in the Chrome window in JavaScript, and then does a standard KM move and click action. This ensures it works without fail.

Due to how Google Chrome calculates window inner and outer dimensions, if you have the web inspector or other panels open, this can calculate positioning wrong.

To make it your own, you can just change which css #id you should be clicking on in the first variable of each group.

Gdocs - Set gray border.kmmacros (13 KB)

1 Like