xxxxxxxxxx
If the alert on the browser comes from JavaScript, we use to
handle them Alert class.
Alert alert = driver.switchTo.alert();
alert.accept();
alert.dismiss();
alert.sendKeys();
alert.getText();
xxxxxxxxxx
<a href="javascript:console.log('javascript');alert('javascript')">Link</a>
xxxxxxxxxx
- Information : You can only accept.
- Confirmation: You can accept or decline.
- Prompt : You can accept, decline, and/or sendKeys.