Dela via


How to: Create an Action Recording for Shared Steps

While you run a manual test using Test Runner, you might have a test that includes shared steps. Shared steps contain a set of common steps that are used in several different tests. For example, several tests may have the identical steps in the application for entering customer address information or logon credentials. Using shared steps saves time and effort when you create a test. For more information, see How to: Share Common Test Case Steps Using Shared Steps and How to: Use Shared Steps While Running a Test.

To reduce the time impact of testing, you can create an action recording that is specific to shared steps. By doing this, you will not have to repeatedly enter identical information numerous times, such as the user logon information, or address information.

Note

You can also create an action recording for a complete test. For more information, see How to: Create an Action Recording.

You can create an action recording for shared steps in two ways:

  • In Test Runner while you are running a test that includes shared steps.

  • In Microsoft Test Manager while you organize and manage your shared steps.

Load a Test into Test Runner

First, you must load a test that contains the shared steps into Test Runner. Then you can create an action recording for shared steps while you run the test. The shared steps can be run automatically when the shared steps are included in this test and other tests.

Selecting test to run in Microsoft Test Manager

To load a test with shared steps into Test Runner

  1. Open Microsoft Test Manager.

    Note

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

  2. On the center group switcher, click the down-arrow and then click Testing Center.

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

  4. In the menu under the center group menu bar, click Run Tests if it is not already selected.

  5. In the left pane, under Run Tests, select either the test plan or the test suite listed under the test plan that contains the test that you want to run.

    The right side pane displays the test cases within the selected test suite.

  6. In the right side pane, click the test case that contains shared steps and then click Run.

    Test Runner opens.

    Note

    Select Run with options to specify a build to run the test on, or to override the test settings and environment settings for the test plan.

Record an Action Recording on a Shared Step Set in Test Runner

First you must load a test that contains shared steps for which you want to create an action recording into Test Runner. For more information, see the previous procedure titled "To load a test with shared steps into Test Runner."

Create an action recording on shared steps

To create an action recording for shared steps in Test Runner

  1. Upon loading a test from Microsoft Test Manager into Test Runner, you are prompted to Start Test with the option Create action recording. Select Create action recording and click Start Test.

    Note

    If the test contains an existing action recording, you are prompted with the option Overwrite existing action recording. Select this option to create a new recording that replaces the previous action recording, and then click Start Test.

    The action recording can be played using the Play option in the toolbar. For more information, see How to: Play Back an Action Recording.

    You can specify which applications to record in your test settings for the actions diagnostic data adapter. If you have configured test settings to create an action log for the test being run, selecting the Create action recording option when you start a test will use the settings that you configured. If you did not configure the actions diagnostic data adapter in your test settings, then the default values are used to create your action recording. For more information, see How to: Record User Interface Actions for Manual Tests Using Test Settings.

    Each test step including launching the application is recorded after you click Start Test.

  2. Perform the steps of the test case and mark each step with a result. Use the drop-down arrow to the right of the step and select either Pass or Fail.

    The words Currently Recording appear in the title bar of each application that is being recorded. An action recording section, presented as a blue indicator, is displayed to the right of the test. The blue indicator is divided into individual sections that correspond to the steps of your test.

    Note

    If you do not mark each test step as passed or failed, then the action recording section can span several test steps. It includes all unmarked test steps since the last step that was marked as passed or failed.

  3. When you reach the shared steps, click the down-arrow next to the shared steps icon and select Start and record.

    The individual steps in the shared steps are new displayed.

  4. Perform the steps in the shared steps and mark each step with a result. Use the drop-down arrow to the right of the step and select either Pass or Fail.

    As with the non-shared steps, the words Currently Recording appear in the title bar of each application that is being recorded.

  5. Click End shared steps.

    An action recording section presented as a blue indicator appears at the right of the shared steps.

  6. If there are any remaining steps in the test case after the shared steps, perform the steps of the test case and mark each step with a result. Use the drop-down arrow to the right of the step and select either Pass or Fail.

  7. Click End Test.

  8. In the toolbar at the top of Test Runner, choose one of the following options:

    • Click Save and Close to save your test results to the Team Foundation Server and close Test Runner.

    • Click Save to save the test results to the Team Foundation Server.

    • Click Close to close Test Runner and not save the test results.

    Note

    If an existing action recording already exists for the test, the Test Runner - Microsoft Test Manager dialog appears with the option to either Overwrite existing recording or Discard new recording.

    The action recording can now be replayed when you run this test case in the future. For more information, see How to: Play Back an Action Recording.

Creating an Action Recording for Shared Steps in Microsoft Test Manager

You can create an action recording for a shared step in Microsoft Test Manager that will automatically run when the shared step is included in test cases.

Create shared step action recording

To create an action recording for shared steps in Microsoft Test Manager

  1. Open Microsoft Test Manager.

    Note

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

  2. On the center group switcher, click the down-arrow and then click Testing Center.

  3. On the center group menu bar, click Organize.

  4. On the menu, click Shared Steps Manager.

  5. In the list of shared step, click the row for the shared step for which you want to create an action recording.

  6. Click Create action recording.

    The Test Runner is displayed.

  7. Click Create action recording.

  8. In Test Runner, perform the steps of the test case.

    The words Currently Recording appear in the title bar of each application that is being recorded. An action recording section presented as a yellow line appears at the right of the test, which is divided into individual sections that correspond to the steps of your test.

  9. Click End shared steps.

    Note

    If you overwrite an existing action recording for shared steps, the Test Runner - Microsoft Test and Lab Manger dialog box will appear informing you of what test cases will be impacted and prompt you to either Overwrite existing recording or Discard new recording.

  10. In the toolbar at the top of Test Runner, choose one of the following options:

    • Click Save and Close to save your test results to the Team Foundation Server and close Test Runner.

    • Click Save to save the test results to the Team Foundation Server.

    • Click Close to close Test Runner and not save the test results.

    The shared steps can now be automatically replayed when you run a test that contains this shared step set.

See Also

Tasks

How to: View Test Results Using Microsoft Test Manager

How to: Play Back an Action Recording

How to: Record a Video of Your Desktop as You Run Tests Using Test Settings

How to: Create an Action Recording for Shared Steps

Concepts

Recording and Playing Back Manual Tests