Recall & Review
beginner
What is a confirmation alert in web testing?
A confirmation alert is a popup dialog that asks the user to confirm or cancel an action, usually with OK and Cancel buttons.
Click to reveal answer
beginner
How do you switch to a confirmation alert in Selenium with Python?
Use
driver.switch_to.alert to switch focus to the alert popup so you can interact with it.Click to reveal answer
beginner
How do you accept a confirmation alert in Selenium Python?
Call
alert.accept() after switching to the alert to click the OK button and confirm the action.Click to reveal answer
beginner
How do you dismiss a confirmation alert in Selenium Python?
Call
alert.dismiss() after switching to the alert to click the Cancel button and cancel the action.Click to reveal answer
intermediate
Why is handling confirmation alerts important in automated testing?
Because alerts block interaction with the page until handled, tests must accept or dismiss them to continue and verify correct behavior.
Click to reveal answer
Which Selenium method switches focus to a confirmation alert?
✗ Incorrect
Use driver.switch_to.alert to access the alert popup.
What does alert.accept() do in Selenium?
✗ Incorrect
alert.accept() clicks the OK button to confirm the alert.
What happens if you do not handle a confirmation alert in Selenium?
✗ Incorrect
Alerts block interaction until accepted or dismissed.
Which method dismisses a confirmation alert in Selenium?
✗ Incorrect
alert.dismiss() clicks Cancel to dismiss the alert.
What type of alert usually has OK and Cancel buttons?
✗ Incorrect
Confirmation alerts ask the user to confirm or cancel an action.
Explain how to handle a confirmation alert in Selenium Python from detecting it to accepting it.
Think about switching focus and clicking OK.
You got /3 concepts.
Why must automated tests handle confirmation alerts properly?
Consider what happens if alert is ignored.
You got /3 concepts.