What is an Alert?
Alerts are pop-up dialog boxes that appear on a web page to convey some important message to the user or prompt the user for some actions. There are three types of alerts you might encounter while interacting with web applications.
There are three types of Alerts:
1. Simple Alerts
It is the most basic type of alert. It is a simple alert that displays the message with an Okay button. It is commonly used to provide some important message to the user.
Example:
2. Confirmation Alerts
It is a type of alert which is used to ask user for confirmation. It displays a message with a Okay and Cancel Button . It is commonly used for asking the user for intent to do something.
Example:
3. Prompt Alerts
It is a type of alert which is used to collect input from the user. It displays a message with a input field, Okay and Cancel Button. It is commonly used to ask the user for some information or input.
Example:
Selenium WebDriver-Handling Alerts
Selenium is one of the most popular and powerful tools for automated web applications. Selenium is widely used for automating user interactions like filling out forms, navigating to a website clicking on a button, etc. While we are dealing with automating user interactions one of the most common scenarios while interacting with web applications is dealing with alerts.