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
Scenario |
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 |
<system.diagnostics> <switches> <add name=”EqtTraceLevel” value=”4″ /> </switches> </system.diagnostics> |
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.
Note:
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
0 comments