Partager via


How to: Collect IntelliTrace Data to Help Debug Difficult Issues

Using Microsoft Test Manager or Visual Studio, you can configure the diagnostic data adapter for IntelliTrace to collect specific diagnostic trace information. Tests can use this adapter, the test can collect significant diagnostic events for the application that a developer can use later to trace through the code to find the cause of a bug. The diagnostic data adapter for IntelliTrace can be used for either manual or automated tests.

Note

IntelliTrace works only on an application that is written by using managed code. If you are testing a Web application that uses a browser as a client, you should not enable IntelliTrace for the client in your test settings because no managed code is available to trace. In this case, you may want to set up an environment and collect IntelliTrace data remotely on your Web server. For more information about environments, see Setting Up Test Machines to Run Tests or Collect Data.

The IntelliTrace data is stored in a file that has an extension of .iTrace. When you run your test and a test step fails, you can create a bug. The IntelliTrace file that contains the diagnostic information is automatically attached to this bug.

Note

The diagnostic data adapter for IntelliTrace does not create an IntelliTrace file when a test pass is successful. It saves a file only on a failed test case or when you submit a bug.

The data that is collected in the IntelliTrace file increases debugging productivity by reducing the time that is required to reproduce and diagnose an error in your code. Additionally, because you can share the IntelliTrace file with another individual who can replicate your local session on their computer, it reduces the probability that a bug will be non-reproducible.

Warning

If you enable IntelliTrace in your test settings, collecting code coverage data will not work. For more information, see Code Coverage configuration using Test Settings is deprecated

Warning

The diagnostic data adapter for IntelliTrace works by instrumenting a managed process, which must be performed after the tests for the test run are loaded. If the process that you want to monitor has already started, no IntelliTrace files will be collected because the process is already running. To circumvent this, make sure that the process is stopped before the tests are loaded. Then start the process after the tests are loaded or the first test is started.

The following procedure describes how to configure the IntelliTrace data that you want to collect. These steps apply to both the configuration editor in Microsoft Test Manager and Test Settings dialog box in Visual Studio.

Note

The user account for the test agent that is used to collect IntelliTrace data must be a member of the administrators group. For more information, see Installing and Configuring Test Agents and Test Controllers.

Configure the Data to Collect with the IntelliTrace Diagnostic Data Adapter

Before you perform the steps in this procedure, you must open your test settings from either Microsoft Test Manager or Visual Studio and select the Data and Diagnostics page.

To configure the data to collect with the IntelliTrace Diagnostic Data Adapter

  1. Select the role to use to collect IntelliTrace data.

  2. Select IntelliTrace.

  3. If you are adding IntelliTrace for a Web client role or for an ASP.NET Web application, you must also select ASP.NET Client Proxy for IntelliTrace and Test Impact.

    This proxy enables you to collect information about the http calls from a client to a Web server for the IntelliTrace and Test Impact diagnostic data adapters.

    Warning

    If you decide to use a custom account for the identity that is being used for the application pool on the Internet Information Server (IIS) where you intend to collect Intellitrace data, you must create the local user profile on the IIS machine for the custom account that is being used. You can create the local profile for the custom account either by logging on to the IIS machine locally one time or by running the following command line by using the custom account credentials:

    runas /user:domain\name /profile cmd.exe

  4. Choose Configure for IntelliTrace to modify default IntelliTrace settings.

    The dialog box to configure the data that will be collected is displayed.

    Warning

    If you enable collecting IntelliTrace data, collecting code coverage data will not work.

  5. Choose the General tab. Select IntelliTrace events only to record significant diagnostic events that have minimal impact on performance when you test.

    -or-

    Select IntelliTrace events and call information to record diagnostic events and method level tracing that shows call information. This level of tracing might have performance impact when you run your tests.

  6. To collect data from your ASP.NET application that is running on Internet Information Services, select Collect data from ASP.NET applications that are running on Internet Information Services. Set up and configure your test agent on the Web server role. See Installing and Configuring Test Agents and Test Controllers.

  7. Choose the Modules tab. Select either Collect data from all modules except for the following and use Add to add to the list of modules and Remove to remove a module. This option lets you include all the modules that are running on the system except the modules that you specify.

    -or-

    Select Collect data from only the following modules and use Add to add to the list of modules and Remove to remove a module. This option lets you specify exactly which modules you want.

    Note

    If possible, select the specific processes that you want to monitor. This is recommended for optimum performance.

  8. Choose the Processes tab. Select Collect data from all processes except for the following and use Add to add to the list of processes and Remove to remove a process. This option lets you include all the processes that are running on the system except the processes that you specify.

    -or-

    Select Collect data from specified processes only and use Add to add to the list of processes and Remove to remove a process. This option lets you specify exactly which processes you want.

  9. (Optional) Choose the IntelliTrace Events tab. Select or clear each IntelliTrace event category that you want to include or exclude when you collect diagnostic events.

  10. (Optional) Expand each IntelliTrace event category and select or clear each specific event that you want to include or exclude in the IntelliTrace events.

  11. (Optional) Choose the Advanced tab. Next, choose the arrow next to Maximum amount of disk space for recording and select the maximum size that you want to enable for the IntelliTrace file to use.

    Note

    If you increase the size of the recording, a time-out issue might occur when you save this recording together with your test results. For more information about how to increase the time-out values for diagnostic data adapters, see How to: Prevent Time-Outs for Diagnostic Data Adapters.

  12. If you are using Microsoft Test Manager, choose Save. If you are using Visual Studio, choose OK. The IntelliTrace settings are now configured and saved for your test settings. 

    Note

    To reset the configuration for this diagnostic data adapter, choose Reset to default configuration for Visual Studio or Reset to default for Microsoft Test Manager.

Guidance

For more information, see Testing for Continuous Delivery with Visual Studio 2012 – Chapter 6: A Testing Toolbox.

See Also

Tasks

Create Test Settings for Automated System Tests Using Microsoft Test Manager

Concepts

Setting Up Machines and Collecting Diagnostic Information Using Test Settings

Debug your app by recording code execution with IntelliTrace

Other Resources

Collect more diagnostic data in manual tests

Specifying Test Settings for Visual Studio Tests

Including Diagnostic Trace Data with Bugs that are Difficult to Reproduce