New to Telerik Test Studio? Download free 30-day trial

Built-In Handlers

Telerik Testing Framework includes native support for HTML pop-ups for all supported 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

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

Logon 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 current dialog to be handled belongs to that browser instance. This is done to ensure the integrity of handling and to limit the chances the DialogMonitor could match a browser that looks similar to the dialog it needs to handle. Also this is needed in multi browser support scenarios.

In this article