This is a migrated thread and some comments may be shown as answers.

Handling Multiple IE modal dialogs

1 Answer 48 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sudarshan
Top achievements
Rank 2
Sudarshan asked on 03 Jun 2013, 03:29 PM
Hi,

How to handle multiple modal dialogs?

On clicking a button in a modal dialog, it opens up another modal dialog.

 I'm not able to handle the new dialog that appears on clicking a button in the existing modal dialog. It's not connecting to the new modal dialog.


Thanks
Sudarshan






1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 04 Jun 2013, 08:28 AM
Hello Sudarshan,

You can handle the second dialog in absolutely the same way as the first one. Here is a sample code:

AlertDialog alertDialog = AlertDialog.CreateAlertDialog(browser, DialogButton.OK);
browser.Manager.DialogMonitor.AddDialog(alertDialog);
browser.Manager.DialogMonitor.Start();
  
//Trigger the dialog
browser.Actions.Click(some element);
alertDialog.WaitUntilHandled();
 
browser.WaitUntilReady();
browser.RefreshDomTree();
  
AlertDialog alertDialog2 = AlertDialog.CreateAlertDialog(browser, DialogButton.OK);
browser.Manager.DialogMonitor.AddDialog(alertDialog2);
browser.Manager.DialogMonitor.Start();
  
//Trigger the dialog
browser.Actions.Click(some element);
  
alertDialog2.WaitUntilHandled();

Make sure the DOM is refreshed after handling the first dialog.

Hope this helps.

Regards,
Boyan Boev
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Sudarshan
Top achievements
Rank 2
Answers by
Boyan Boev
Telerik team
Share this question
or