Re: [Watin-users] How to click on two dialog handlers?
Brought to you by:
jvmenen
From: Rolf O. <rol...@gm...> - 2009-05-05 14:39:24
|
Hi Jeroen, Many thanks for reply. Here is the code that I'm using ------ ConfirmDialogHandler confirm = new ConfirmDialogHandler(); ie.AddDialogHandler(confirm); AlertDialogHandler alert = new AlertDialogHandler(); ie.AddDialogHandler(alert); Span deleteArticle = ie.Span(Find.By("innertext", "Delete")); deleteArticle.ClickNoWait(); confirm.WaitUntilExists(60); confirm.OKButton.Click(); // Clicking on this shows up an another Alert dialog handler alert.WaitUntilExists(60); alert.OKButton.Click(); ie.WaitForComplete(); Scenario is that as soon as deleteArticle is clicked it brings up "confirm" and clicking on the OK button of "confirm" brings up "alert" and finally clicking on the OK button of "alert" completes the whole action. Above code throws this exception --- WatiN.Core.Exceptions.WatiNException : Dialog not available within 60 seconds. --- So my approach is certainly wrong. Am I missing something? Please enlighten me. Thanks, Oltmans On Tue, May 5, 2009 at 1:12 PM, Jeroen van Menen <jv...@li...> wrote: > Hi Rolf, > It shouldn't be a problem to add more than one dialoghander to the > dialogwatcher so you can handle multiple dialogs at once. > HTH, > Jeroen > > On Tue, May 5, 2009 at 2:35 AM, Rolf Oltmans <rol...@gm...> wrote: >> >> Hey all, >> >> There is a scenario where a dialog box appears and clicking on the OK >> button on that dialog box reveals another Alert dialog box with OK and >> Cancel button and text "Are you sure you want to navigate away from >> this page?". So I've been able to successfully launch and click on the >> first dialog handler's OK button but I've no idea how to handle the >> second one (which appears as soon as I click on the OK button on the >> first dialog handler). Here is how I'm handling the first dialog >> handler (which seems to be working fine) >> ------ >> Span deleteArticle = ie.Span(Find.By("innertext", "Delete")); >> deleteArticle.ClickNoWait(); >> >> confirm.WaitUntilExists(60); >> confirm.OKButton.Click(); >> ie.WaitForComplete(); >> ----- >> >> Please pardon my ignorance. Any helps is really appreciated. >> >> Thanks, >> Oltmans >> >> >> ------------------------------------------------------------------------------ >> Register Now & Save for Velocity, the Web Performance & Operations >> Conference from O'Reilly Media. Velocity features a full day of >> expert-led, hands-on workshops and two days of sessions from industry >> leaders in dedicated Performance & Operations tracks. Use code vel09scf >> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf >> _______________________________________________ >> Watin-users mailing list >> Wat...@li... >> https://lists.sourceforge.net/lists/listinfo/watin-users > > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK > i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Watin-users mailing list > Wat...@li... > https://lists.sourceforge.net/lists/listinfo/watin-users > > |