How to: Submit a Bug Using Microsoft Visual Studio

You can submit a bug using Visual Studio at any time. You can manually attach information to this bug and link it to other work items. Using Visual Studio to submit a bug does not automatically add data that was collected when a test was run, unlike when you create a bug using Test Runner or Microsoft Test Manager. For more information about these methods, see Submitting Bugs.

You can submit a bug from Visual Studio without having to switch to Microsoft Test Manager. For example, you perform ad hoc testing and find a bug, or you notice incorrect behavior from discussion of the application under test. You can also create a bug about a particular test result from the Test Runs window and you can link a test result to an existing work item.

To submit a bug using Microsoft Visual Studio

  1. To open the Team Explorer view to connect to Team Foundation Server, click Tools and point to Connect to Team Foundation Server. Select the server from the list of servers.

    For more information about how to connect to Team Foundation Server, see How to: Connect to a Team Project in Team Foundation Server.

  2. To connect to a specific team project, select the team project and then click Connect.

  3. To create a bug, right-click Work Items then click Add Work Item and point to Bug.

    The New Bug tab is displayed.

  4. Type an appropriate title in Title.

  5. Click Area to select the appropriate area in the team project for this bug.

  6. Click Iteration to select the appropriate iteration for this bug.

  7. (Optional) To select the user to assign to this bug, click Assigned to.

  8. (Optional) To change the state of this bug from the default state of active, click State.

  9. (Optional) To enter the reason for this bug, click Reason.

  10. To assign a priority to the bug, click Priority.

  11. To assign a severity to the bug, click Severity.

  12. To enter the details to re-create the bug, click Details.

  13. (Optional) To enter the system information, click System Info.

  14. (Optional) To link this bug to specific test cases, click Test Cases. Click Add and then click Browse to search for the test cases to link to this bug.

  15. (Optional) To add attachments to this bug, click Attachments. Any file can be added. For example, you could add a video recording file, a screen shot file or a log file.

  16. To save the bug, click Save on the toolbar.

To create a bug from a test result

  • Open the test run with the test results you want.

    1. On the Test menu, point to Windows, and then click Test Runs.

    2. In the Test Runs window, in the Connect list, click the down arrow, and then click Connect to test run.

    3. In the Connect to Controller or Local Results dialog box, select either a remote controller or a local directory and then click OK.

Note

If you select a local directory, click Browse to find the correct TestResults folder. By default, results for locally run tests are saved to Visual Studio 2010\Projects\Project Name\TestResults.

  1. In the Test Runs window, double-click a test run to open the results of that run in the Test Results window.

Note

How many runs are available depends a setting in the Options dialog box that limits the number of test runs that can be saved.

  1. In the Test Results window, right-click the test you want to create a work item for and click Create Work Item.

  2. In the Test Run Not Yet Published message box, click Yes to publish your test results. Publishing test runs makes them available to the work item.

  3. In the Publish Test Results dialog box, select the test runs you want to publish and click OK.

    How many runs are available depends a setting in the Options dialog box that limits how many test runs are saved.

  4. Select the build against which you ran the tests, select a Build flavor, and then click OK.

  5. Fill out the work item form and in the toolbar, click Save Work Item.

    The work item is added to your team project and a link to the test results file appears on the attachments tab. When you open the attachment the test results open in the Test Results window.

  • Open the test run with the test results you want.

    1. On the Test menu, point to Windows, and then click Test Runs.

    2. In the Test Runs window, in the Connect list, click the down arrow, and then click Connect to test run.

    3. In the Connect to Controller or Local Results dialog box, select either a remote controller or a local directory and then click OK.

Note

If you select a local directory, click Browse to find the correct TestResults folder. By default, results for locally run tests are saved to Visual Studio 2010\Projects\Project Name\TestResults.

  1. In the Test Runs window, double-click a test run to open the results of that run in the Test Results window.

  2. Right-click the test run and click Add to Work Item.

  3. In the Test Run Not Yet Published message box, click Yes to publish your test results. Publishing test runs makes them available to the work item.

  4. In the Publish Test Results dialog box, select the test runs you want to link to from the work item, select the build against which you ran the tests, select a Build flavor, and then click OK.

    How many runs are available depends a setting in the Options dialog box that limits how many test runs are saved.

  5. In the Work Items Picker, locate and click the work item, and then click OK.

    The work item is added to your team project and a link to the test results file appears on the attachments tab. When you open the attachment the test results open in the Test Results window.

See Also

Concepts

Submitting Bugs