mstest.exe 位于哪里?
我需要从命令行运行 mstest - 这个 exe 位于世界何处?谁能给我一个线索吗?
编辑:我只安装了 Visual Studio 2010
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
Visual Studio 命令提示符是您的朋友。对我来说它在
from the Visual Studio Command Prompt is your friend. For me it's in
输入...
在 Visual Studio 命令提示符中
Type
into a Visual Studio Command Prompt...
自 Visual Studio 2012(至少是 Express 版本)起,MsTest.exe 被称为
vstest.console.exe
,可以在以下位置找到:Since Visual Studio 2012 (at least the express versions) MsTest.exe is called
vstest.console.exe
and can be found at我偶然发现这篇文章是因为我正在尝试自动化一些网络测试。
当然,您可以从 Visual Studio 命令提示符运行 >mstest /TestContainer:some.webtest - 但是当您将其放入批处理文件中时,默认执行的命令提示符不包含 Visual Studio 工具。
您可以搜索 mstest.exe,但该位置在不同机器上可能不相同,因此在 c:\
Rany Miller 的答案中硬编码是不明智的(谢谢!) - 他建议
%VS90COMNTOOLS%\ ..\IDE\MSTest.exe
但如果你有 VS 2010,这不起作用。只需将 90 替换为 100。我的批处理文件,我可以将其安排为每晚运行的任务,如下所示:
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:
如果找不到,请尝试这样搜索:
If you can't find it, try searching like this:
我的自动化测试脚本使用:
我使用的完整命令是:
My automated test scripts uses:
The full command I use is:
如果您在运行脚本之前运行 Visual Studio 命令提示符(这在大多数情况下应该是可行的),您可以运行 %VSINSTALLDIR\Common7\IDE\mstest -- 这意味着您可以随 VS 版本一起移动,并且如果用户安装在不同的目录中,则不必对目录更改做出反应。
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.
如果人们只知道 Windows 可以搜索文件...
您只需打开 Visual Studio 的命令行提示符将该目录包含在 PATH 中即可。看一下开始菜单条目“Visual Studio 2008 命令提示符”。
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".