How to: Use Recorded Actions in Bugs to Create Test Cases

While performing manual testing, you might want to create test cases from any bugs that you find and use the test cases to create a regression test suite. Microsoft Test Manager can simplify this process. When you find a bug, you can record the actions to reproduce it as text in a log file. This action log is saved with your test result. You can automatically add this action log to any bug that you create while you run a manual test. You can then use this action log to create a manual test case from a bug or a test result. This makes it easier to create test cases from steps that you have already performed without having to type all the steps. You can update this test case as necessary.

To create a test case from the action log saved with your test results and not in a bug, see How to: Use Recorded Actions to Create Test Cases.

For example, if you ran a test and after the first two steps, you found an issue by digressing from the steps in the test. You can log a bug and it will record these new UI actions that you took when you digressed from the steps in the test. You can then create a new test case that you can use to retest the bug when it is fixed, as shown in the following illustration.


  • Visual Studio Ultimate, Visual Studio Premium, Visual Studio Test Professional

Tip Tip

Using Microsoft Test Manager, you can also perform exploratory test sessions, which are ideal for discovering manual test case paths. For more information, see Performing Exploratory Testing Using Microsoft Test Manager and How to: Create a New Manual Test Case from an Exploratory Testing Session.

Create a Test Case From a Bug
Note Note

You can also create a test case from the recorded actions in a bug when you have a query listing bugs in the Queries activity. For more information about this, see How to: Track Your Bugs Using Microsoft Test Manager.

To create an action log when you run your test, you must use a test settings with the action log selected. For more information about this, see How to: Record User Interface Actions for Manual Tests Using Test Settings in Microsoft Test Manger.

To use recorded actions in bugs to create test cases

  1. Open Microsoft Test Manager.

    Note Note

    To display the Microsoft Test Manager window, choose Start, and then choose All Programs. Point to Microsoft Visual Studio 2012 and then choose Microsoft Test Manager.

  2. Choose the down-arrow on the center group selector and then choose Testing Center.

  3. On the center group menu bar, choose Test.

  4. To view the bugs currently assigned to you, choose Verify Bugs.

    The Verify Bugs view is displayed. It lists all the bugs that are currently assigned to you.

  5. (Optional) To view the bugs created by you, choose Created by me.

  6. Select the bug from the list that has the recorded actions you want to use for a new test case.

    Note Note

    If the bug that you want to use to create a test case is not your bug, you can find the bug using a custom query. To create a custom query from the My Bugs activity, choose Edit. For more information about how to create a query, see How to: Track Your Bugs Using Microsoft Test Manager.

  7. To create the test case from the steps of the action log, choose Create test case from bug.

    The New Test Case activity is displayed. It shows the test steps from the action log now added to your test case.

  8. To name the test case, type the name in Title.

  9. (Optional) To link the test case to other work items that this test case tests, choose All Links and then choose Add. Next, type the items in Work item IDs, or browse for the items and then choose OK.

    The work items are listed in Tests.

    Note Note

    The bug is automatically added as an associated work item in Other Links.

  10. To display the steps that were added, choose Steps.

  11. To remove any test steps that you do not require in the test case, select the step and then choose the delete icon. For example, you may want to remove the steps that show a step was completed or that the parent window was changed.

  12. (Optional) To add expected results to the steps, choose Expected Result and type the name of your text.

  13. To add any additional steps, choose <Choose here to add a step>, and then type the details of the test step.

  14. Under Action, type the action that the tester takes to perform this test step.

  15. (Optional) Under Expected Result, type the result that the user should expect after the action has been performed.

    Note Note

    If you add expected results to a test step, it automatically becomes a validation test step shown by the red check mark on the step icon. By default, each test step is an action test step and does not require validation when you run this step. When you run the test case, you must individually mark a validation test step as either passed or failed. If you do not, the test will automatically be assigned a status of fail.

  16. To add another test step, choose Enter. You can add as many test steps as you require for your test.

  17. To insert a test step, right-click a step and select Insert step.

    Note Note

    The step will be inserted above the step that you have selected.

  18. To save the test case, choose Save and Close.

    Note Note

    For more information about how to create a manual test case, see How to: Create a Manual Test Case.