Question on how to click a button using document.querySelector javascript

Yep, that's a good command. I use it a lot.

Given this HTML:

then this JavaScript should work, provided it is the first element with that attribute:

var btnElem = document.querySelector('button[data-automation="sdk-update-grade-button"]');
btnElem.click();

Put that in a Execute a JavaScript in Front Browser action.

No guarantees of course, since I can't test it. :wink:

Next time, if you can't provide the URL, then please provide a large block of the HTML code as text using a Forum Code Block, with "html" as the language.

Good luck.

1 Like