With the next version of Microsoft Test Manager, MTM11, there is a possibility to clone test suites across plans. This is something which can be very helpful if you’re working on multiple releases. This way, you can clone an existing Test Suite from a previous release, and just change the necessary things related to the new release. When you clone a test suite, the new suite will contain the copies of all test cases in the source suite. However it will not retain all historical data like the previous test runs, the related bugs, old results. It provides a clean starting point.
This feature is available through the command line utility tcm.exe. You can start this utility using the ‘Developer Command Prompt‘ from Visual Studio 11 (beta). Start->All Programs->Microsoft Visual Studio 11->Visual Studio Tools. Enter ‘tcm‘ to see the list of available commands:
We will continue with the ‘tcm suites’ command. This command will provide us all operations related to Test Suites, like listing and cloning. The first thing you can do is get a list of all available Test Suites using the ‘tcm suites /list’ command. This will give you a list of Suites with an ID and a Name. This ID is useful to know when you want to clone from one Suite to another Suite. For each command you want to execute, you have to provide the URL of your Team Project Collection and the Team Project Name you want to work with. In my case (using the great HOL VM from Brian Keller), the command is:
tcm suites /list /collection:http://vsalm:8080/tfs/DefaultCollection /teamproject:FabrikamFiber
In this example above, I have “TestPlan1” containing the ‘A Demo Suite‘ test suite. What I want to do is clone this test suite into “TestPlan2“. So I want Id 3 to be cloned in Id 2. To do this, just use this command:
tcm suites /clone /suiteid:3 /destinationsuiteid:2 /collection:http://vsalm:8080/tfs/DefaultCollection /teamproject:FabrikamFiber
When this command is executed, the clone operation is ongoing. This command returns an operation Id back. This Id is an identifier of the actual clone process. In some cases, a test plan/test suite can contain a large number of test cases, resulting in an operation which can take a serious amount of time. In my case, it’s only a small one. What you can do to follow the process of the clone operation is executing the following command:
tcm suites /clone /status:2 /collection:http://vsalm:8080/tfs/DefaultCollection /teamproject:FabrikamFiber
As you can see, the operation ‘2‘ has succeeded. You also have some information about the clone operation like the number of test cases cloned and the cloned shared steps.
Each clone operation is stored in the TFS_DefaultCollection (or TFS_YourTPC) database. You can get an overview using table ‘tbl_CloneOperation’ where you have the same information as in the screenshot above.
This is a nice (hidden) feature in the new improved version of Microsoft Test Manager 11. I hope they will include this command in the interface so you don’t have to use the commandline version of the tool. Thanks for reading!