i-think Twenty-Two

Now with more coherency.

Disabling the debug trace output in Coded UI Tests

| Comments

The Coded UI tests in Visual Studio 2010 are pretty cool. For the last few months I’ve been using the framework to completely automate a sophisticated web application, with lots of drag and drop and crazy design surfaces.

But the test details page has always looked a little verbose. The default Debug trace is full of so much stuff that I find it completely unusable, and what it does have is barely legible anyway. So usually I just collapse the section and move on to my own less verbose logging and the stack trace.

Unfortunately all this information comes at a bit of a price and I have seen machines run into the good ol' OutOfMemoryException more than once while working with the log. So to eliminate that cause from the list of possible culprits I hit the net and went searching for how to disable the debug trace in Coded UI Tests.

Unfortunately I didn’t find much (other than how to enable, and usually by editing the test agent configuration). I wanted to find a solution that I could add to my solution (damn overloaded words) that would just work no matter what machine I ran the tests on. Fortunately it was really easy. I just added an App.config file with the following:

1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.diagnostics>
    <switches>
      <add name="EqtTraceLevel" value="0" />
    </switches>
  </system.diagnostics>
</configuration>

It did the trick and it is making my life a whole lot easier. Hopefully it helps someone else too. (You could also try other values for the level, but I’m an all or nothing kind of guy).

Comments