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

Built-In Handlers

Telerik Testing Framework ships with native support for HTML pop-ups and built-in dialog handling framework (under the ArtOfTest.WebAii.Win32.Dialogs namespace) with handlers for the common browser dialogs like Alert, Prompt and Confirm, Upload and Download dialogs, and Logon dialogs, WPF dialogs. The framework also enables you to extend this support to handle any custom dialogs in the specific manner you need.

Below is a list with references on how to handle each popup or specific dialog.

  • HTML Pop-ups - New browser instance or tab, which is invoked by an action on the current page.

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

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

  • Prompt 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.

  • File Upload Dialogs - You need to pass in the full path to the file to upload and how the dialog should be handled.

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

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

  • Handle Custom Dialogs - 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