November 2012
Intermediate to advanced
326 pages
6h 41m
English
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 false.
In this recipe, we will handle a confirm box using the Selenium WebDriver's Alert class.
Let's create a set of tests that handle a confirm box displayed on a page as follows:
testConfirmAccept test, we will accept the confirm box and verify a message on the page when ...Read now
Unlock full access