Enabling Tracing and HtmlLogger in Coded UI Test

Aditya_msft

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

  1. Open <Visual Studio Installation Folder>Common7IDEQTAgent32_40.exe.config
  2. Modify value for EqtTraceLevel to the log level you want
  3. Save the file

Target framework version v4.5 & no app.config file present in the test project

  1. Open <Visual Studio Installation Folder>Common7IDEQTAgent32.exe.config
  2. Modify value for EqtTraceLevel to the log level you want
  3. Save the file

App.config file present in test project

  1. Open App.config file in the project
  2. Add following entry under configuration node

<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

Discussion is closed.

Feedback usabilla icon