Avoiding Dialog Handling Problems with the UnexpectedDialogAction Feature

PROBLEM

You're running tests as part of a test list. You're having trouble with dialog handling steps that timeout.

SOLUTION

The problem is likely related to your test list settings. There's a feature called UnexpectedDialogAction which allows the tests (in a test list) to automatically handle dialogs that are deemed "unexpected." Since it's hard to distinguish between expected and unexpected dialogs, this feature will try to handle all dialogs in your tests. Here's how determine whether this is the problem you're experiencing:

 

Try running the problematic test as part of a test list and then by Quick Execution. If a dialog handling problem seems to exist only in the test list execution, change the UnexpectedDialogAction setting.

 

HandleAndFailTest

Your test fails as soon as a dialog appears. This is the default mode. This can cause unexpected failures since the feature might not be able to determine correctly whether a dialog was expected.

 

HandleAndContinue

This handles dialogs and allows the test to continue running. This can lead to problems because this mode handles dialogs faster than dialog handling steps. If your test contains a dialog handler step, it will timeout if the HandleAndContinue mode handles the associated dialog first.

 

DoNotHandle

This turns off UnexpectedDialogAction.

 

If you determine that UnexpectedDialogAction is causing unpredictable behavior in your test lists, set it DoNotHandle and the problem should disappear.

 

In Test Studio Standalone version, set UnexpectedDialogAction from the "Edit Test List Settings" menu:

 

              

 

In the Visual Studio plugin, edit the .testsettings file that corresponds to the test list run: