I have used to click buttons on the webpage using javascript through KM without any problem. However, I couldn't click the popup window in Chrome. Take an example...
In the print dialog, I would like to click the "Cancel" button.
In the console, I used the following script to click the button successfully
document.querySelector("body > print-preview-app").shadowRoot.querySelector("#sidebar").shadowRoot.querySelector("print-preview-button-strip").shadowRoot.querySelector("div > cr-button.cancel-button").click()
However, the same script didn't work by using KM
Certainly, I could use multiple keystokes ("tab") to perform the same task alternatively. However, I would like to understand why the JS failed in the popup dialog.
Thank you very much!