How can we handle Web-based Pop-ups or Alerts in Selenium?
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.