I've written a series of integration tests and have associated them with matching test cases in TFS. I'm currently running the tests with MSTest and have successfully published the results to the server.

Problem: None of my results are appearing in Microsoft Test Manager. How can I ensure that the test results become available in Microsoft Test Manager with the associated test cases?


Unfortunately, I don't think this scenario is possible with mstest. The /publish command is supposed to be used to associate test runs with builds. MTM is displaying test results that are associated with test plans/suites which are somewhat independent of builds.

I think you're going to have to use tcm.exe to get what you're after. It's a command line interface to running tests, similar to mstest, but it runs the tests through the infrastructure you set up in MTM. Here's the documentation page: http://msdn.microsoft.com/en-us/library/dd465192.aspx

| improve this answer | |
  • Looks like that's the case. Microsoft just confirmed that it can't be done as is. – Mike Cluck Jun 12 '14 at 14:47
  • Tcm actually works pretty well once you get everything set up. One annoying thing is that it'll immediately exit once it starts a test run, so you might have to do something to wait for it. The TFS api helps with this. – thebeekeeper Jun 12 '14 at 16:17

This link describes the steps to set this up: http://msdn.microsoft.com/en-us/library/dd286680(v=vs.110).aspx

Specifically, about half way down the page: "If you want to run your automated tests and have the results added to a test plan, you can associate your automated tests with test cases using Visual Studio, and then run them using Microsoft Test Manager, as shown in the following illustration."

| improve this answer | |
  • Thanks but the problem is that I need to run my tests through mstest, not Microsoft Test Manager. – Mike Cluck Jun 11 '14 at 0:01

Have you tried the publish command?

/publish:[ server name]

Use the /publish option to publish test data to the database for the team project collection associated with the project's Team Foundation Server. When you use the /publish option, you must correctly specify the name of the Team Foundation Server. The correct format depends on whether the Team Foundation Server has been registered on the client computer, as described here:

| improve this answer | |
  • Yes and it reports that the results have been successfully published but they don't appear in MTM. The tests I'm running are associated with certain test cases but when I go to view the results in MTM, it says no results exist. – Mike Cluck Jun 11 '14 at 13:41

Have you tried the VSTest.Console.exe (here)?

I have done this with the /logger:TfsPublisher option and a link to the MTM test result was provided with the completed test execution. It turns out that there isn't a way using the UI to get to this test result record, but with the link the test result record was visible.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.