How to click a Google Chrome Xpath?

Hi folks,

I'm using the Click Google Chrome Link action, trying to click the Xpath element at

/html/body/div[36]/div/div/div/div[1]/div[2]/div[1]/div[1]/div/div/div/div[3]/div/div/div[4]/table/tbody/tr/td[2]/table/tbody/tr[2]/td/div/div/div[4]/table/tbody/tr/td[6]/div/div[1]/div/div[2]

(If you use Gmail, just open a compose window and this Path should reference the three-vertical-dots menu at the bottom right of the compose window.)

I got the Xpath in Chrome by doing Inspect Element > Copy Full Xpath.

Why not just use Inspect > Copy Xpath? Because there's an ID in there which changes for every new compose window. Only the full Xpath is the same from one compose window to the next.

I can't get it working! It says can't find Xpath. Help?

Yikes, I'm not sure I've ever seen such a dynamic page source code. Anyway, I love clicking links directly but at this point I'd probably use the "Click at Found Image" action and move on with my next task :slight_smile:

I tried using JavaScript with querySelector, and I could get a reference to the proper element, but it would NOT respond to the click() method.

I also tried several other buttons/link in that Compose window, and none of them would respond to a click() method.

So my guess is that Google has done some black magic to prevent JavaScript insertion of a click event.

Given that, I have to agree with @vincent_ardern that using a found image might be your best bet. I would use the "Send" button with an offset to the 3-dot "More options" button.

Good luck and let us know if you find a solution.

Thank you very much! How do I retrieve the Send button image?

Use the macOS screen capture tool.

That's very sexy. And how do I find the offset to the 3 vertical dots?

Use the same macOS tool to measure from center of "Send" button to center of "More options" button.

Whoahhhhhhhh

What an amazing product is Keyboard Maestro. Licensing now...!