In my team, we use MS Test Manager for Test Case Management Application. I had to migrate all of our test cases(2000) from our old TFS Team Project to a new one. Unfortunately, I found out that MS Test Manager has a built-in feature only for transferring test cases between test plans. This means that you can copy your test cases structure only between test plans in the same TFS Team Project.
However, you can use the Test Case Manager for the job.
How to Use Test Case Manager to Migrate TFS Test Cases?
- Download the latest version of the tool from https://testcasemanager.codeplex.com
- Connect to your TFS Team Project and specify your test plan
- Click on “Migrate Test Cases” tab
- Select Source Team Foundation Server Project
- Select Source Test Plan
- Select Destination Team Foundation Server Project
- Select Destination Test Plan
- Select Default JSON files folder
- Select Test Suites to be skipped
The source test plan is used to get the initial tree of suites, it’s not used to filter the test cases for migration. The test cases are shared between different test plans. If you want to skip the migration of test cases that are used in various test plans, create a new suite in your source test plan named “ToBeSkipped”. Insert all test cases that you desire to be skipped into it. You can view all test cases if you click to the “All Test Cases” tab and then click “All” node of the Suites Tree.
Add the “ToBeSkipped” suite to the “Test Suites To Be Skipped” grid of the “Migrate Test Cases” view.
The idea behind the JSON files is that if the process fails for some reason and you initialize a new migration, you don’t want to insert the already processed test cases again, shared steps or suites. The JSON files keep the current state of the migration process. You have a separate file for each phase of the procedure.
If the phase is started for the first time you should leave the “Retry JSON Path” empty, the application will create a new file with a new unique name. If problems emerge, specify the JSON file for the problematic step. The tool will ignore the already processed items.
- Migrate Shared Steps
- Migrate Test Suites
- Migrate Test Cases
- Add Test Cases To Suites
Before you can create your test cases in your new team project, you need to create all referenced shared steps. Next you need to create their suites. Then you are ready to migrate the test cases. The last step is to add your test cases to their test suites. If something fails along the line, you need to load the generated JSON files because they keep all mappings between the old entities and the new ones. E.g. old shared step id – new shared step id. If this information is missing the creation of the new test cases is impossible.
The Test Suites listed in the “Test Suites To Be Skipped” will not be migrated. Test Cases placed in the suites listed there will not be processed. Of course, the suites with these names will also not be created in the Suite Tree of the destination Test Plan.
You can find the detailed log of the process in the Default Test Case Manager Log. It’s placed in your default Documents folder: %USERPROFILE%\Documents\TestCaseManager\ExecutionLog.log.