From: Vinay M. <vin...@gm...> - 2005-02-02 08:00:48
|
Hi, I am using HtmlUnit to fill up a page that pops up javascript alerts when certain buttons are clicked or when a textbox loses focus. I need to be able to capture these alerts and fetch the messages conveyed therein. Is there a way to check for these alerts in an asynchronous manner ? In the sense, is there anything else that I can do apart from : 1) designating an instance of "CollectingAlertHandler" to maintain a list of alerts that might show up on a page 2) and then, keep checking if the list of alerts in CollectingAlertHandler got populated everytime I enter a value on the site ? Basically, I am looking for an "event listener" that gets notified whenever an alert shows up on a page. The "event listener" could then delegate the handling of the event to an appropriate "event handler". Does HtmlUnit support this kind of a feature ? Does popping up of an alert qualify as a WebWindowEvent, so that I could use a handler implementing WebWindowListener ? Thanks and Best Regards Vinay Murthy |