다음을 통해 공유


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

                                                                          /teamProject:abcProject

                                                                          /workItemType:TestCase

                                                                          /mode:PREVIEW

         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

                                                                          /teamProject:abcProject

                                                                          /workItemType:TestCase

                                                                          /id:6

                                                                          /mode:COMMIT

        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

                                                                      /teamProject:abcProject

                                                                      /workItemType:TestCase

                                                                      /mode:COMMIT

Comments

  • Anonymous
    February 07, 2014
    This totally corrupted my test case by replacing all the steps with the HTML eqivalent.
  • Anonymous
    February 09, 2014
    Hi Joan,Did your test case contain '<' or '>'?Was it a TFS 2010 test case upgraded to 2012/2013?Also, did you run the tool in preview mode to find out if the test case contained the error that this tool is supposed to fix?If no results were returned in preview mode, then this tool should not have been run on the test case.Please do not run the tool using 'id' option unless that 'id' was detected as a corrupt test case by the tool in preview mode.Please follow the recommended usage.In case you are facing any issues with corrupted test case please drop a mail to abchakra@microsoft.com. I will be glad to help.Thanks
  • Anonymous
    April 29, 2014
    I've found that an ampersand in a test case step or expected result also breaks Test Scribe.  Any chance this tool can be updated to identify and/or correct that?Thanks.
  • Anonymous
    May 07, 2014
    Abhijit - I as well had a test case corrupted via this tool.  I followed the steps and found a test case that your tool identified.  The test case showed << and >>  Is that the reason for my actions to show now as <FlowDocument xml:space="preserve" xmlns="schemas.microsoft.com/.../presentation"><Paragraph>Pages will be shown as hyperlinks on the left side of the page (below the list).</Paragraph></FlowDocument>Ideas?
  • Anonymous
    January 04, 2015
    when will Microsoft be updating visual Studio 2012/MTM 2012 to fix this bug I should be able to use MTM 2012  as intended without having to use an additional tool to fix my test cases. The Generate utility in MTM 2012 should ignore angular brackets  < > and  ampersands "&".  
  • Anonymous
    January 20, 2015
    Totally agree with Allan Baehm.  When can we expect a patch from Microsoft to fix this bug?  85% of our test cases are existing test cases that contains angular brackets to indicate a button. We need a fix to this bug ASAP.