Where is mstest.exe located?

2019-01-17 19:12发布

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

9条回答
Animai°情兽
2楼-- · 2019-01-17 19:31
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\
查看更多
唯我独甜
3楼-- · 2019-01-17 19:32

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:\

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
查看更多
smile是对你的礼貌
4楼-- · 2019-01-17 19:32

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

查看更多
贪生不怕死
5楼-- · 2019-01-17 19:36

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]
查看更多
叼着烟拽天下
6楼-- · 2019-01-17 19:43

Type

where mstest.exe

into a Visual Studio Command Prompt...

查看更多
乱世女痞
7楼-- · 2019-01-17 19:43
"%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE
查看更多
登录 后发表回答