Update test steps utility

In 2012 release, rich text support was added to test steps control in Microsoft Test Manager(MTM).

As part of this feature, the format in which test steps xml is stored in Team Foundation Server(TFS) was also changed.

Recently, we observed an issue with test steps when a test case created in TFS 2010 is upgraded to TFS 2012 / 2013.

The issue is with test cases having test steps containing angular brackets ('<', '>').

If such a test case is modified using MTM 2012 / 2013, then text within the angular brackets disappear and  test steps formatting (specifically newlines)  is lost.


To fix this issue we have created a small command line utility that will identify the test cases / shared steps with the above issue and fix them.

You can download the tool

here - for MTM 2012

here - for MTM 2013


Ensure that MTM 2012 / 2013 is installed on the machine where you run the tool.

How to use the utility:

UpdateToTFS2012Format /collection: <teamprojectcollectionurl>

                                                  /teamProject: <teamProject name>

                                                  /workItemType: <type of work item to be modified>

                                                  [/id: <id of the test case / shared step to be updated> ]

                                                  [/mode: <PREVIEW|COMMIT> ]

/collection                       The url link of the TFS  team project collection

/teamProject                  The name of the team project

/workItemType               Can be either 'TestCase' or 'SharedStep'

/id:                                    Id of the test case to be updated

/mode:PREVIEW           Identifies the list of test cases that will be updated by the tool

                                         and generates IdsOfSharedStepsToBeModified.txt / IdsOfTestCasesToBeModified.txt

/mode:COMMIT             Updates test steps in all test cases identified in preview mode.

                                         In case id option is specified, only that test case is updated.


Recommended usage:

  1. Run in preview mode to identify all the test cases / shared steps (based on work item type specified as cmd line arg) that will be modified.

               e.g. UpdateToTFS2012Format /collection:abc-tfs:8080/tfs/Collection




         2. Rename the file IdsOfTestCasesToBeModified.txt( or, IdsOfSharedStepsToBeModified.txt in case sharedsteps is specified as workItemType) and save it separately.

         3. Create a copy of one of the test cases identified in the above step. (as a backup).

         4. Try updating the above test case with say id: 6.

                e.g. UpdateToTFS2012Format /collection:abc-tfs:8080/tfs/Collection





        5. Validate that the test case has been modified properly and things are working as expected.

        6. Repeat steps 3-5 with some other test cases to make sure that test cases are being updated properly by the tool.

        7. Once confident, update all the test cases identified in the preview mode by running the following command

            e.g. UpdateToTFS2012Format /collection:abc-tfs:8080/tfs/Collection