Dela via


How to: Use Recorded Actions to Create Test Cases

When you run a test case using Test Runner from Microsoft Test Manager, you can create an action log that stores each action that you performed with the UI for the application under test as text in a file. For more information about how to create an action log, see How to: Record User Interface Actions for Manual Tests Using Test Settings.

You can use this file to create the steps in your test cases, or to give you a quick start for creating the steps, without having to retype each action. For example, you could create a test case, Add Item to Shopping Cart, with just one test step named Create Test Steps. By using test settings to collect the action log, you can then run that test and perform all the necessary actions to add an item to your shopping cart. Each UI action is stored in the action log when you end the test. You can take this text in the action log file and copy the data to Microsoft Excel, and then modify the data and copy and paste this into your test case to create your test steps.

To use recorded actions to create test cases

  1. Open Microsoft Test Manager.

    Note

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

  2. From the Testing Center, click Plan and then click Contents.

    The Contents pane is displayed.

  3. Select the test suite in the test suite hierarchy pane that you want to add test cases to, and then choose New.

    The New Test Case dialog box is displayed.

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

    You use this title to identify the test case and search for it if you have to.

  5. Update the other test case fields as required.

    For more information about the other fields, see How to: Create a Manual Test Case.

  6. Choose Steps and then choose <Click here to add a step>.

  7. Add one test step under Action, type the action to create test steps.

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

  9. To create a test settings to use to run this test, locate the Lab Center, choose Test Settings, and then choose New.

    The Test Settings dialog box is displayed.

  10. In Name, type Create Action Log.

  11. Under What type of tests do you want to run, select Manual.

  12. Under Steps, select Roles and verify that Local is selected under Sets of roles.

  13. Choose the Data and Diagnostics step and select Actions and clear all other items. Then choose Configure next to Actions.

    The Configure Diagnostic Data Adapter - Actions dialog box is displayed.

  14. Select Applications in the following list and then enter the process name for your application under test.

  15. To save the test settings, choose Save.

  16. To apply the new test settings for the test, from the Testing Center, choose Plan and then choose Properties.

  17. Under Manual runs, choose the Test Settings drop-down list and select your Create Action Log test settings.

  18. Choose the Test tab in the Testing Center and then choose Run Tests.

  19. Select the test suite that contains the test you want to run.

  20. Open the context menu on the test shown in the list of tests and point to Run.

    The Test Runner is displayed.

  21. Choose Start test and then perform the UI actions for your application that you want to save into your action log.

  22. When you have completed the actions, mark the test step with a state of Pass and then choose End Test.

    The action log files are shown in the list following Attachments and bugs drop-down list.

  23. Choose the file to display the action steps that were performed during the test.

  24. Optional: To reset the test, choose Reset on the toolbar in Test Runner.

  25. Optional: To modify the test case, close Test Runner and in Microsoft Test Manager choose Plan and then choose Contents. Select the test suite for the test case in the test suite hierarchy and then double-click the test case in the test suite details pane to open it.

  26. Open the context menu on <Click here to add a step> and then point to Paste.

    The actions you selected from the action log are added as actions to the test steps.

  27. Remove the original test step that you added to use to create the action log.

  28. (Optional) Add expected results for the test steps as required.

  29. To save the test steps that you added to the test, choose Save and Close.

See Also

Tasks

How to: Run Manual Tests

Concepts

Creating Manual Test Cases