Skip to content

Instantly share code, notes, and snippets.

@poguez
Last active March 11, 2020 10:13
Show Gist options
  • Save poguez/b828c4525ff1d8b8102bcbe393663bbe to your computer and use it in GitHub Desktop.
Save poguez/b828c4525ff1d8b8102bcbe393663bbe to your computer and use it in GitHub Desktop.
Click on two buttons repeatedly with a delay on the browser
function clickaRetry(){
document.querySelector("body > console-base-page > stencil-router > stencil-route-switch > stencil-route > datastore-request-status-page > div > enhanced-table > div > table > tbody > tr > td > div > confirmation-button div > button[data-role=\"retry-request\"]").click()
}
function clickaConfirm(){
document.querySelector("body > console-base-page > stencil-router > stencil-route-switch > stencil-route > datastore-request-status-page > div > enhanced-table > div > table > tbody > tr > td > div > confirmation-button div > button[data-role=\"confirm\"]").click()
}
function sleep(milliseconds) {
let timeStart = new Date().getTime();
while (true) {
let elapsedTime = new Date().getTime() - timeStart;
if (elapsedTime > milliseconds) {
break;
}
}
}
function toma() {
sleep(300);
clickaRetry();
sleep(900);
clickaConfirm();
}
window.setInterval(toma, 7000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment