Class CollectingAlertHandler
java.lang.Object
org.htmlunit.CollectingAlertHandler
- All Implemented Interfaces:
Serializable, AlertHandler
A simple alert handler that keeps track of alerts in a list.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance, initializing it with an empty list.CollectingAlertHandler(List<String> list) Creates an instance with the specified list. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all alerts.Returns a list containing the message portion of any collected alerts.voidhandleAlert(Page page, String message) Handles the alert.
-
Field Details
-
collectedAlerts_
-
-
Constructor Details
-
CollectingAlertHandler
public CollectingAlertHandler()Creates a new instance, initializing it with an empty list. -
CollectingAlertHandler
-
-
Method Details
-
handleAlert
Handles the alert. This implementation will store the message in a list for retrieval later.- Specified by:
handleAlertin interfaceAlertHandler- Parameters:
page- the page that triggered the alertmessage- the message in the alert
-
getCollectedAlerts
-
clear
public void clear()Removes all alerts.
-