Long back I had posted on “How To: Enable Tracing for UI Test Components”. The trace files have helpful information that could help the support team debug the problem that you may be running into. Ideally, the steps for enabling tracing on Microsoft Test Manager (MTM) should have been exactly same but those are not.  The steps for MTM are slightly different (or rather superset) and are given below.

Step 1

The quick and easiest way to enable tracing for all Testing Tools in VS is to use the registry files in the zip attached. The zip has two files – one to enable and another to disable tracing. SECURITY WARNING – Please validate the registry file before importing. The registry file is -

For VS\MTM 2010 -

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\EnterpriseTools\QualityTools\Diagnostics]
"EnableTracing"=dword:00000001
"TraceLevel"=dword:00000004

For VS\MTM 11 Beta -

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\EnterpriseTools\QualityTools\Diagnostics]
"EnableTracing"=dword:00000001
"TraceLevel"=dword:00000004

In the above, the EnableTracing variable controls whether tracing is ON or OFF.

  • 1 means tracing is ON
  • And 0 means OFF.

The TraceLevel variable is for level (granularity) of tracing.

  • 1 means Errors only
  • 2 is Errors and Warnings
  • 3 is Errors, Warnings and Information
  • 4 is All including Verbose Information

Typically for reporting issues, it is good to set it to 4.  Once you have reported the issue, you should turn the tracing off by changing EnableTracing to 0.  Alternatively, use the DisableTrace.reg file in the attached zip.

Step 2

Add following highlighted lines to mtm.exe.config file present at <Install Location>\Common7\IDE.

    <!-- End: Test execution settings -->
    <add key="TestRunnerFolderName" value="ManualTestTempFolder"/>

    <add key="TestManagement.EnableSoapTracing" value="true" />
    <add key="TeamBuild.EnableSoapTracing" value="true" />

  </appSettings>

  <system.diagnostics>
    <switches>
      <!-- Trace settings for MTR -->
      <!-- Change the value to change the level of tracing you want.
            You must use integral values for "value". 
            0 ==> off,
            1 ==> error,
            2 ==> warn,
            3 ==> info,
            4 ==> verbose.
            Note that each value is inclusive of the last.
        -->
      <add name="UITestTraceLevel" value="4" />
      <add name="EqtTraceLevel" value="4" />
      <add name="TestManagement" value="4" />
      <add name="TeamBuild" value="4" />
      <add name="TeamFoundationSoapProxy" value="Verbose" />
    </switches>
    <trace autoflush="true">
    </trace>
  </system.diagnostics>
</configuration>

Alternatively, you can copy the mtm.exe.config file from the attached zip too.  Do not forget to take a backup of your original file.

Once you have set this up, you will start seeing MTM logs in %TEMP% as mtm.EqtTrace.log.

Once you have collected the logs, refer this blog for best practice around reporting the issues.

 

UPDATE

Additionally if you are testing Windows 8 Metro style app and want to generate trace logs for the remote Windows 8 device too, you will need to modify C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\ide\mtta.exe.config on the Windows 8 device.  The modification required is to add\update the line highlighted below -

  <system.diagnostics>
    <switches>
      <!-- Trace settings for MTR -->
      <!-- Change the value to change the level of tracing you want.
            You must use integral values for "value". 
            0 ==> off,
            1 ==> error,
            2 ==> warn,
            3 ==> info,
            4 ==> verbose.
            Note that each value is inclusive of the last.
        -->
      <add name="UITestTraceLevel" value="4" />
      <add name="EqtTraceLevel" value="4" />             
 
  </switches>
    <trace autoflush="true">
    </trace>
  </system.diagnostics>
</configuration>