Skip to main content

Posts

Showing posts from February, 2020

Error: org.openqa.selenium.UnhandledAlertException: unexpected alert open

Error: org.openqa.selenium.UnhandledAlertException: unexpected alert open Solution: basically, this message shows   selenium is not able to handle alert or window popup or browser popup message Use this code to handle this issue: public void clickOKAlertAccept() throws InterruptedException {            // you can ignore the step written in first try block. Also DRIVER I have defined for browser in my code. try {               Alert alert = DRIVER .switchTo(). alert ();         alert .accept(); } catch (Exception e ) {        try { if ( e .toString().contains( "org.openqa.selenium.UnhandledAlertException" ))   {            Alert alert = DRIVER .switchTo(). alert ();         alert ...