From: Brad C. <yo...@br...> - 2005-05-10 18:28:16
|
Since I was editing the wiki anyway I posted my ConfirmHandler implementation here: http://htmlunit.sourceforge.net/phpwiki/index.php/ConfirmHandlerExample OK and Cancel are handled by returning true or false from handleConfirm. There is no dialog object, only the text of the confirm message and your choice of return value. Brad C --- Jeff Marendo <jma...@ho...> wrote: > After reading the information in the "How do I use JavaScript..." section, I > know I need to implement the ConfirmHandler interface to work with a confirm > dialog. I don't understand how to achieve two things, though: > > 1. When a confirm is triggered during the execution of a HtmlTest case, how > do I simulate the user input for what would be selected (that is, 'ok' or > 'cancel')? > 2. How would you capture that in the handleConfirm( final Page page, final > String message ) method? > > My guess is that there must be a way to access the dialog via the argument > page, but even so, I'm still not clear on it particularly when considering > question #1. > > This might be easy, but I'm just getting into using HtmlUnit so any help > would be appreciated. Thanks. > > Jeff > |