Steps:
- Get the reference of the main window
- Switch to Alert popup
- As per requirement accept or dismiss alert
- Switch back to main window
String mainWindow = driver.getWindowHandle(); Alert alert = driver.switchTo().alert(); alert.accept(); //alert.dismiss(); driver.switchTo().window(mainWindow );
No comments:
Post a Comment