Mike
Mike

Reputation: 1071

How to skip or disable displaying crash message box in Win7

I'm developing and running Coded UI automated tests on virtual machines. The process that executes the UI automation is QTAgent32_40.exe Occasionally (quite rarely) - QTAgent crashes, for unknown (at the moment) reason. The problem is that test is stuck forever until I close the error message, and any further tests do not run. I get this message - tried to look into stack trace - nothing useful: Windows reporting error

I googled a bit, and tried to disable the windows error reporting service, now the message is different: Generic error message

I would like to disable or close the message somehow - so that the Agent could restart and continue. I've read all the questions about QTAgent - but could not find solution to my issue.

Upvotes: 0

Views: 112

Answers (1)

user3163684
user3163684

Reputation: 114

I'm assuming you have no control ober QTAgent32.exe, you just start it using

System.Diagnostics.Process.Start("QTAgent32.exe"); 

(or something similar) and wait for it to complete.

In that case, you could use a timeout and just kill it if it doesn't want to exit peacefully:

var process = Process.Start("QTAgent32.exe");
Thread.Sleep(60000); // Wait for one minute
if (!process.HasExited)
{
    process.Kill();
}

Edit: You could of course use polling, meaning a loop containing shorter wait times and checking if the process has exited, instead of always waiting for a minute.

Upvotes: 1

Related Questions