Last active
March 11, 2020 10:13
-
-
Save poguez/b828c4525ff1d8b8102bcbe393663bbe to your computer and use it in GitHub Desktop.
Click on two buttons repeatedly with a delay on the browser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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