Complete the code to switch to the confirmation alert.
alert = driver.switch_to.[1]()The switch_to.alert() method switches the driver focus to the alert popup.
Complete the code to accept the confirmation alert.
alert = driver.switch_to.alert()
alert.[1]()The accept() method clicks the OK button on the confirmation alert.
Fix the error in the code to dismiss the confirmation alert.
alert = driver.switch_to.alert()
alert.[1]()The dismiss() method clicks the Cancel button on the confirmation alert.
Fill both blanks to get the alert text and then accept the alert.
alert = driver.switch_to.[1]() text = alert.[2] alert.accept()
First, switch to the alert using alert(). Then get the alert message text using text.
Fill all three blanks to switch to alert, print its text, and dismiss it.
alert = driver.switch_to.[1]() print(alert.[2]) alert.[3]()
Switch to the alert with alert(), print the alert message with text, and cancel the alert with dismiss().
