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 ...
Learning and Sharing Technical Knowledge related to testing, performance testing, QA , Quality Assurance, automation, jmeter, loadrunner, selenium, cucumber, regression stetting, continuous testing, devops, Agile, Scrum