Q. Which method is used to switch to an alert in Selenium?

A
switchToAlert()
B
switchTo().alert()
C
handleAlert()
D
moveToAlert()
Solution:

switchTo().alert() switches the WebDriver focus to an alert popup for interaction.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!

    [honeypot honeypot-100]