How the alerts in HtmlUnit will be handled? For Supposeenter image description here
It is not required to click "OK" in htmlUnit. But in selenium, it will throw UnhandledAlertException. How it is different in HtmlUnit from Selenium.
How the alerts in HtmlUnit will be handled? For Supposeenter image description here
It is not required to click "OK" in htmlUnit. But in selenium, it will throw UnhandledAlertException. How it is different in HtmlUnit from Selenium.
HtmlUnit does not stop the processing when an alert is reached - instead there is an alert handler (registered for the client) that decides how to proceed.
The default alert handler simply accepts the alert (clicks the ok button).
You can register your own AlertHandler (htmlunit/src/main/java/com/gargoylesoftware/htmlunit/AlertHandler.java) and process every alert individually (if required).