Built-In Dialog Handlers

Telerik Testing Framework includes native support for HTML pop-ups for all browsers in addition to a dialog handling framework (under the Win32.Dialogs) namespace with built-in support to handle some of the common browser dialogs like JavaScript Alert, Upload dialog and Logon dialog. The framework also enables you to extend this support to handle any custom dialog you need handled in any manner.

 

HTML Pop-ups -  Browser instances that are invoked by some action on an element of the page.

 

Modal Dialogs Don't act like standard HTML pop-up windows and require special handling

 

JavaScript Dialogs You only need to define how the dialog should be handled.

 

Win32 Dialogs - It is not a browser window, but a dialog displayed by the Windows operating system.

 

FileUpload Dialog - You need to pass in the full path to the file to upload and how the dialog should be handled.

 

Handling File Downloads - You have a number of classes included that make handling of the file download dialogs very easy.

 

Custom Dialog Handler - You can craft your own dialog handling code and then ask the dialog to call your code instead of its dialog handling code.  

 

 

There are a few things to note about dialog handing:

  • The dialog monitor can take 1-N dialogs and they can be added/removed at any point in your test code regardless of whether the monitoring has started or not.
  • Notice how each dialog takes in an instance of a parent browser that will eventually produce the dialog. Before handling each dialog the DialogMonitor makes sure that the dialog it is handling belongs to that browser instance. This is done to ensure the integrity of the handling and to limit the chances that the DialogMonitor would match a browser that looks similar to the dialog it needs to handle. Also this is needed in multi browser support scenarios.