<!DOCTYPE html>
<html>
<body>
<h2>Biggnars platform</h2>
<script>
window.alert("My known programming languages are python,c# and java");
</script>
</body>
</html>
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();
3 types of JS Alerts
- Information : You can only accept.
- Confirmation: You can accept or decline.
- Prompt : You can accept, decline, and/or sendKeys.