Where is mstest.exe located?

.NetTestingMstestFile Location

.Net Problem Overview


I need to run mstest from the command line - where in the world is this exe located? Can anyone give me a clue?

Edit: I only have Visual Studio 2010 installed

.Net Solutions


Solution 1 - .Net

for %x in (mstest.exe) do @echo.%~dp$PATH:x

from the Visual Studio Command Prompt is your friend. For me it's in

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\

Solution 2 - .Net

Type

where mstest.exe

into a Visual Studio Command Prompt...

Solution 3 - .Net

Since Visual Studio 2012 (at least the express versions) MsTest.exe is called vstest.console.exe and can be found at

> C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe

Solution 4 - .Net

I stumbled across this post because I'm trying to automate some web tests.

You can run >mstest /TestContainer:some.webtest from the visual studio command prompt, sure - but when you slap that in a batch file the command prompt that's executed by default doesn't have the visual studio tools included.

You can search for mstest.exe, but that location might not be the same across machine, so it's unwise to hardcode in c:<any-path>

Rany Miller's answer was god's send to me (thanks!) - he suggested %VS90COMNTOOLS%\..\IDE\MSTest.exe

But that doesn't work if you have VS 2010. Just replace the 90 with 100. My batch file, that I can schedule as a task to run nightly, looks like this:

SET SOURCEe=c:\myTestProjectFolder\
CD %SOURCE%
"%VS100COMNTOOLS%..\IDE\mstest.exe" /TestContainer:some.webtest

Solution 5 - .Net

If you can't find it, try searching like this:

%VS90COMNTOOLS%\..\IDE\MSTest.exe

Solution 6 - .Net

My automated test scripts uses:

"%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe"  

The full command I use is:

"%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe"  /testcontainer:[PathToTestDll] /resultsfile:[TrxOutputPath]

Solution 7 - .Net

If you run a visual studio commmand prompt before you run your scripts -- which should be doable in most situations -- you can run %VSINSTALLDIR\Common7\IDE\mstest -- this means that you can move with the version of VS, and not have to react to director changes if users install in a different directory.

Solution 8 - .Net

"%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE

Solution 9 - .Net

> C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE

If people only knew that Windows can search for files...

You can simply open up Visual Studio's command line prompt to include that directory in the PATH. Take a look at the start menu entry "Visual Studio 2008 Command Prompt".

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGeorge MauerView Question on Stackoverflow
Solution 1 - .NetJoeyView Answer on Stackoverflow
Solution 2 - .NetLooferView Answer on Stackoverflow
Solution 3 - .NetdwonischView Answer on Stackoverflow
Solution 4 - .NetDave KennedyView Answer on Stackoverflow
Solution 5 - .NetRandy MinderView Answer on Stackoverflow
Solution 6 - .NetAlan JacksonView Answer on Stackoverflow
Solution 7 - .NetDominic HoptonView Answer on Stackoverflow
Solution 8 - .NetAsadView Answer on Stackoverflow
Solution 9 - .NetAndiDogView Answer on Stackoverflow