Handle alert
Do you want to leave this site?
I am using chrome 64 for selenium Java.
Getting Below Error:
rg.openqa.selenium.UnhandledAlertException: unexpected alert open: {Alert text : }
(Session info: chrome=64.0.3253.3)
Handle alert
Do you want to leave this site?
I am using chrome 64 for selenium Java.
Getting Below Error:
rg.openqa.selenium.UnhandledAlertException: unexpected alert open: {Alert text : }
(Session info: chrome=64.0.3253.3)
Try to handle the Alert by doing something like this :
//Dismiss the alert
driver.switchTo().alert().dismiss();
//Accept the alert
driver.switchTo().alert().accept();
Have a look at this article for more information about alert handling in selenium.
You can use alert interface for that
Alert alert = driver.switchTo().alert();
alert.accept(); //for accept
alert.dismiss();//for dismiss