How to handle Windows' exception dialogue upon test run?

Jun 30, 2009 at 1:37 PM


Is there a way to catch and handle Windows' exception dialogue (those one with "Send Error Report" / "Don't Send" buttons) upon test run?

I.e. if Application-under-test (AUT) throw an exception which leads to the dialogue => how is it possible to get exception details, close the dialogue and AUT?

Thank you.

Jul 1, 2009 at 1:12 AM

Yes- The bad news is that getting this reliably integrated into your test automation is non-trivial. If you have the choice, making the AUT rock solid for intercepting exceptions gracefully (including wrt worker threads), should allow you to avoid most if not all process crashes, thus avoiding that dialog in the first place.


Ok- that said, there are definitely cases beyond our control, where crashes just happen. What you likely would want to do is the following:

  1. Register the Windows and .NET Jit(Just-In-Time) Debugger settings to use your custom debugger, rather than the default "Send Error Report" mechansim. Info on this is covered at "Enabling JIT-attach Debugging" You may want to roll back your custom settings after running tests, so your custom debugger doesn't intercept other crashes during regular use of windows.

  2. Also, you will need an automated debug mechanism to collect the pertinent crash details - Debugging Tools for Windows can be automated to gather the same kinds of details you would expect from the VS debugger -

  3. Finally, you will probably want to integrate the results of that debugging mechanism back into your test log.


I hope that is of some help,


Jul 13, 2009 at 7:23 AM

Thank you for the clues!