I am an Automation tester with the background of QTP & QC combination. Recently i moved to a new project where client using Microsoft Test Manager for Testing. I am doing a POC by using QTP. One of my main task(R&D) is Updating the Test Manager after QTP execution. I am trying to automate "Test Case Migrator Plus" utility to update the test cases in Test Manger but i couldn't do it.
Is it possible to automate the "Test Case Migrator Plus" utility?
Is there any ways are available to Automate MTM? (DLLs or COM)
- there has to be a build and build server configured. It doesn't have to be a real build. If you need it, I can give you the API calls to create a fake build and build server. They'll be in C#, but it's not that hard to convert to VBScript. Once you've got a build, you will need to associate it to the test run.
- there is no direct link between test cases in TFS and test case results. It's a series of indirect linkages involving test points (test case plus test configuration - you must have your TFS test cases assigned to at least one test configuration), the test run, the run results object and within the run results object, the run iteration results object. The code I used in the first stack overflow link is ugly, but it does the job.
- I recommend (strongly) testing against a sample test run until you have the code to export your results working. It's not easy. It took me days to work this out.
- Each TFS test case you touch *must* have a corresponding test result if you want the test run to complete. Any test cases with test points that are part of the run and have no corresponding result will return as an undefined result and leave the test run in an incomplete state. The API won't allow you to change the state of the run yourself.
- You'll need to URL Encode any strings with spaces that you send through the TFS API. The API runs through SOAP calls, so it needs that encoding to correctly handle project names with spaces.
- A rough (very rough) representation of the TFS API structure with respect to test cases and results :
Test Plan Test Run
+--Test Suite +-- Test Run Results
+-- Test Case +-- Test Run Results Iteration
+-- Test Step < -- Indirect link -- > +-- Test Step Result
The result for each upper level is the worst result in the lower levels (if one step fails, the test case, suite, and plan fails, as does the run)
You can also attach files to the test run - I recommend doing this: the last thing your QTP run should do is save the test results to that point and attach them to the TFS/MTM test run. You should be able to transform them to an easily readable format such as HTML.