Types of Alerts in Selenium
There are three types of Alert in Selenium, described as follows:
- Simple Alert
- Prompt Alert
- Confirmation Alert
An Alert is nothing but a small message box that appears on the screen to give some kind of information and give a warning for a potentially damaging operation or permission to perform that operation.
1. Simple Alert
The simple alert in selenium shows some information or warning on the window.
2. Confirmation Alert
The confirmation alert asks for the permission to do some type of operations.
3. Prompt Alert
Prompt Alert asks some input from the user.
How to Handle Alert in Selenium using Java?
Imagine filling out a form online and accidentally missing some information. You only know if you made a mistake if the website tells you somehow, like with a pop-up message. This article explains what those pop-up messages are called in Selenium (alerts) and how to deal with them in your automated tests.