From: Alan G. <al...@cr...> - 2006-12-19 17:40:56
|
Brad Clarke wrote: > It's an internal thing of ours (well, I released it once but nobody > seemed to care :p ). > > Just replace the call to setLastConfirmMessage with whatever you need > to do to make use of the message in the confirm box--if you just wanna > click no matter what it says then you don't need to do anything. > > Brad C It's making sense, now I'm a little bit confused on how to handle the situation where I'm calling a javascript method to do the confirm: *** function confirmThis() { if (confirm("Clicking OK will destroy the universe. Proceed?")) { window.location = "kaboom"; } return false; } *** I have an anchor with a href of "#" with an onClick call to that javascript (basically "<a href='#' onClick='confirmThis(); return false;'>Click me</a>"). If I have an acceptance test that looks something like: *** public void testClickLink() { /* ala JUnit TestCase */ loadPage(); // wrapper for some HtmlUnit stuff, creates // a "Page" instance called myPage clickLink("Click me"); HtmlUnitConfirmHandler confirm = new HtmlUnitConfirmHandler(); confirm.handleConfirm(myPage, "Clicking OK will destroy the universe. Proceed?"); } *** I'm a little confused on how to handle the javascript with the confirm handler and the client side redirect. Would I need to set up a "ScriptResult" instance to check for this? -- Alan Garrison (216) 221-4600 x308 Cronosys -- Liberate the soul of your business <http://www.cronosys.com>. |