Click to Rate and Give Feedback
MSDN
MSDN Library
 How to: Share Common Test Case Step...
Collapse All/Expand All Collapse All
How to: Share Common Test Case Steps Using Shared Steps

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

You can share steps between manual test cases by creating shared steps using Microsoft Test and Lab Manager. For example, the test steps to log on to your application under test might have to be run in several test cases. By sharing the steps, you have to maintain changes in the shared steps only. You can create shared steps from within a test case, or you can create shared steps in the Shared Steps Manager in Organize. You can also edit and copy shared steps in the Shared Steps Manager if you require.

You can create an action recording for shared steps from the Shared Steps Manager. An action recording enables you to speed up your manual testing by playing back the shared test steps automatically. For more information, see How to: Create an Action Recording for Shared Steps.

If you want to run your test cases that have shared steps multiple times with different data, you can add parameters to the shared steps. For more information about parameters in shared steps, see How to: Add Parameters to Shared Steps.

The following illustration shows you how to create shared steps from existing steps in a test case.

Create Shared Steps
NoteNote

If you modify shared steps, this can affect other test cases that are using these shared steps. You might want to check that your changes will not cause other test cases to fail.

Use the following procedures to create and use shared steps:

To create shared steps from existing steps in a test case

  1. Open Microsoft Test and Lab Manager.

    NoteNote

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

  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 contains your test case.

  4. To open the test case that has the common steps you want to share with other test cases, double-click the test case listed in the Test Suite Details pane.

  5. Click Steps.

  6. Select the sequence of steps that you want to share. To extend the selection over several steps, hold down SHIFT until you click the last step.

  7. Right-click and point to Create shared steps.

    The Create Shared Steps dialog box appears.

  8. Type a unique name in Title and click OK.

    The shared steps are now shown in the test steps for this test case.

  9. (Optional) To edit these shared steps, right-click the shared steps and point to Open shared steps. Make your changes as required, and then click Save and Close.

  10. To save the test case, click Save and Close.

To insert shared steps in a test case

  1. Open Microsoft Test and Lab Manager.

    NoteNote

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

  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 contains your test case.

  4. To open the test case that requires the shared steps, double-click the test case listed in the Test Suite Details pane.

  5. Click Steps.

  6. To add shared steps to the test case, right-click a step and point to Insert shared steps.

    The Browse and Insert Shared steps dialog box appears.

  7. Select the shared steps to insert from the list and then click Insert.

    The shared steps are inserted above the selected step.

    NoteNote

    You can open the shared steps to view the individual test steps. Right-click the shared steps and point to Open shared steps. Or, if you pause your mouse over the shared steps, the details for the shared steps are displayed in the tooltip.

  8. Click Save and Close to save the test case.

To create shared steps from the Organize Center

  1. Open Microsoft Test and Lab Manager.

    NoteNote

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

  2. From the Testing Center, click Organize and then click Shared Steps Manager.

    The Shared Steps Manager pane is displayed.

  3. To create shared steps, click New.

    The New Shared Steps dialog box is displayed.

  4. To name the shared steps, type the name in Title.

    You use this title to identify the shared steps and search for them if you have to.

  5. Click Area to select the appropriate area in the team project for the shared steps.

    NoteNote

    The areas are set up by your Team Foundation Server administrator for the team project. You can use the area field to query for shared steps.

  6. Click Priority to select the importance of the shared steps.

  7. Click Assigned To to select the appropriate owner for the shared steps.

  8. (Optional) To change the state of shared steps, you must first save the shared steps. After you save the shared steps, you can select a state from the list, based on the following table:

    State

    When to use it

    Active

    The shared steps can be used in any test case.

    Closed

    The shared steps are no longer required for future iterations of this team project.

    NoteNote

    By default, State is set to Active.

  9. (Optional) To add a detailed description of the shared steps, click Summary and type the details in Description.

  10. Click Steps.

  11. Click <click here to add a step>, and then type the details of the test step.

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

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

    NoteNote

    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. When you run the shared steps, 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.

  14. To add another test step, click Enter. You can add as many test steps as you require for your shared steps.

  15. To save the shared steps, click Save and Close in the toolbar.

    The shared steps are displayed in the list in the shared steps manager.

© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker