Tests will need to verify that the user is shown correct alerts while testing. It would also be required to handle alerts while performing an end-to-end workflow. The Selenium WebDriver provides an
In this recipe, we will handle a simple alert box using Selenium WebDriver's
Alert class. A simple alert box is often used to notify the user with information such as errors, warnings, and success. When an alert box pops up, the user will have to click on the OK button to proceed, as shown in the following screenshot: ...