Enabling Tracing and HtmlLogger in Coded UI Test
Enabling HtmlLogger & Tracing in Coded UI Test
There have been a few changes in Visual Studio 2012 how Coded UI Test are run & how to enable logging. Now we can have both .NET v4.0 & v4.5 type Coded UI Test projects. Note this is an extension to previous blog on enabling tracing for Coded UI Test which is also applicable for Coded UI Test as well.
Below are various ways for enabling logs in Coded UI Test
Method to enable log
Target framework version v4.0 & no App.config file present in the test project
Target framework version v4.5 & no app.config file present in the test project
App.config file present in test project
<add name=”EqtTraceLevel” value=”4″ />
Enabling logging from Test code itself
Playback.PlaybackSettings.LoggerOverrideState = HtmlLoggerState.AllActionSnapshot;
Please refer to MSDN
These same settings are applicable for Visual Studio 2012 Test Agent as well.
In the blog Analyzing Coded UI Tests Using Coded UI Test Logs there are two more configuration settings mentioned for enabling Html Logger in Coded UI Test.
<add key=”EnableHtmlLogger” value=”true”/>
<add key=”EnableSnapshotInfo” value=”true”/>
Both of these settings have been *deprecated* in Visual Studio 2012 RTM. EqtTraceLevel is the only setting which is required to be modified to enable HtmlLogger