A Mobile Application Testing Community
Web-based popup is otherwise known as server authentication popup. You can handle it by using below:
There are basically two types of alerts/pop-ups used in automation testing by software testing services:
1. Web-based alert pop-ups
2. Windows-based alert pop-ups
What is Alert box/ Pop up box/:
Alert or pop-up is a small box which appears on the display to give some kind of information:
There are basically four methods which are used to handle the pop-up:
1) void dismiss() – The dismiss() method is used clicks on the “Cancel” button
2) void accept() – The accept() method is used clicks on the “Ok” button
3) String getText() – The getText() method returns the text displayed on the pop-up box.
4) void sendKeys(String stringToSend) – The sendKeys() method enters the specified string pattern into the pop-up box.
Alert alert = driver.switchTo().alert();