21

Using Visual Studio 2013 plus TFS and MTM. Want to run tests from the command line. There are three programs available. How do I choose which of tcm.exe, mstest.exe and vstest.console.exe I should use?

Microsoft provides many pages about each of the three programs, telling what they do and how to use them. My researches had not found any pages that compared the programs and explained how one should choose between them. The page listed in Kate Paulk's answer gives a start on comparing the programs.

2
  • 1
    Hi, AdrianHHH - what has your research found that doesn't answer your question? Some things you might want to add here - what kind of tests do you want to run? What do you want to do with them?
    – Kate Paulk
    Commented Jan 17, 2014 at 16:57
  • 1
    Sounds like you found Kate's answer helpful--would you consider marking it accepted so this question shows up as answered?
    – c32hedge
    Commented Aug 31, 2017 at 15:10

3 Answers 3

18

To start with, according to the MSDN documentation I found with a quick search, each tool is optimized for a specific kind of test automation.

  • tcm.exe - Team Foundation Server/MTM test cases associated with automation - this runs the test cases, rather than directly running the tests and automatically updates the test case status (I think - I'm not that familiar with it). It appears to be functionally a command line wrapper around MTM's ability to run automation.
  • vstest.console.exe - Microsoft unit tests and Microsoft CodedUI tests.
  • mstest.exe - this is the "legacy" tool which will run anything Visual Studio recognizes as a test. It's the tool you need to use with load and performance tests created in Visual Studio and can be used to send test results to Team Foundation Server.

Without knowing what kind of tests you want to run and what you want to do with them, it's not possible to give a more detailed answer.

1
  • 1
    You can publish results to TFS with vstest.console.exe too with the /logger:TfsPublisher; option. See msdn.microsoft.com/en-us/library/jj155796.aspx. One thing I noticed: The .trx file from vstest is less complete than the .trx file from mstest. For example the <description> element and <Properties> element collection is missing. A drawback: I have test publishing tooling (Pickles) that rely on those elements. Commented Nov 17, 2014 at 9:26
3

There are a few pages that describe the differences between newer VSTest.Console.Exe and older MSTest.exe.

Choose and configure a test runner
VStest support recent features, including Fakes. However some features(such as database unit tests, load and web tests) supported only in old MSTest.

vstest.console.exe – CommandLine Test Runner
Gives a brief summary on the various switches provided by Mstest.exe and the equivalent switches in vstest.console.exe.

Replace MSTest to VSTest to support Fakes
Describe parameters that should be changed if you move from MSTest to VSTest.

1
  • The word press blog seems to be removed. could you please provide instruction on how to replace mstest to vstest to support fakes
    – Esen
    Commented Sep 7, 2016 at 18:50
0

Here is a link for you: How to: Run Automated Tests from the Command Line Using MSTest

I haven't read it, just a quick Google search. But, I would start here if I were in your shoes. I hope, it helps you. On the other hand, MSDN documentations are helpful.

1
  • 1
    The question is about selection from 3 tools, your link is about only 1 Commented Apr 7, 2016 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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