How to Verify Dialog Text (Internet Explorer only)
I would like to verify the text of a Dialog that is fired from the browser during test execution.
Solution
This is possible with a coded solution. The code serves two purposes. It handles the dialog and verifies the text within it. The first part is the standard way to handle dialogs in code as seen here. The second part uses a delegate to implement a custom handler for the dialog.
Note: This code requires an assembly reference to System.Windows.Forms. Here is an article on how to add an assembly reference in the Standalone version.
Ensure you add the following using or Imports statements to the top of the code-behind file. Click the View Entire Code Behind File button, scroll to the top of the code, and add these lines: