How can we handle Web-based Pop-ups or Alerts in Selenium?

947    Asked by RaghavSingh in QA Testing , Asked on Nov 13, 2019
Answered by Raghav Singh

To deal with Web-based alerts or popups, we have to change to the ready window and call Selenium WebDriver Alert Programming interface strategies.

dismiss(): To tap on the Cancel button.

accept(): To Tap on the Ok button.

getText(): To get the content which is available on the alert.

sendKeys(): To enter the content into the alert box.



Your Answer

Interviews

Parent Categories