Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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?

share|improve this question

4 Answers 4

up vote 0 down vote accepted

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

share|improve this answer
    
Looks like that's the case. Microsoft just confirmed that it can't be done as is. –  Mike C Jun 12 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 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."

share|improve this answer
    
Thanks but the problem is that I need to run my tests through mstest, not Microsoft Test Manager. –  Mike C Jun 11 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:

share|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 C Jun 11 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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