A confirm box is often used to verify or accept something from the user. When a confirm box pops up, the user will have to click either on the OK or the Cancel button to proceed, as shown in the following screenshot:
If the user clicks on the OK button, the box returns
true. If the user clicks on the Cancel button, the box returns
In this recipe, we will handle a confirm box using the Selenium WebDriver's
Let's create a set of tests that handle a confirm box displayed on a page as follows:
testConfirmAccepttest, we will accept the confirm box and verify a message on the page when ...