i mean on:
alert("Hello! I am an alert box!!");
can i accept it with code?
cuz i cant actually even write code on the console when an alerts pops, so I even tried stuff like:
function sleep(ms)
{
return new Promise(resolve => setTimeout(resolve, ms));
}
// this line above is to wait for X time until the code executes
async function whatEver()
{
await sleep(5000);
alert.accept();
}
async function whatEver2()
{
await sleep(5000);
new WebDriverWait(driver, 10).until(ExpectedConditions.alertIsPresent()).accept();
}
}
And none will work, is it even possible to accept the alerts with code? if so, appreciate any help orienting me :)