简体   繁体   English

Visual Studio的“测试资源管理器”输出位于何处?它是保存的文件吗?

[英]Where is the Visual Studio 'Test Explorer' Output located? Is it a saved file?

I'm using SpecFlow for unit testing in Visual Studio 2013, and when I run tests from the Test Explorer window, there is a link to an Output which shows anything written to the console during the test. 我在Visual Studio 2013中使用SpecFlow进行单元测试,当我从Test Explorer窗口运行测试时,会有一个指向输出的链接,该输出显示测试期间写入控制台的任何内容。

输出链接

When right-clicking the tab, I don't have the option to Open Containing Folder like I do with other project files. 右键单击选项卡时,我没有像打开其他项目文件那样打开包含文件夹的选项。

与路径相关的选项不可用

Is this a file that's being saved somewhere? 这是一个被保存在某个地方的文件吗? Can I access it somewhere, or should I manually write the code to save it to a known location? 我可以在某处访问它,还是应该手动编写代码以将其保存到已知位置?

After digging around a bit I couldn't find a way to actually view the results from the test explorer window run. 在挖掘了一下之后,我找不到实际查看测试资源管理器窗口运行结果的方法。 So the best I can do is give you an alternative. 所以我能做的最好的就是给你一个选择。

What you will want to do is run your test using a program called vstest.console.exe, this works almost exactly the same way as running from VS. 你想要做的是使用名为vstest.console.exe的程序运行测试,这与从VS运行的方式几乎完全相同。 You can find it under 你可以找到它

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

run this from your cmd/terminal and set it up as you would like. 从你的cmd /终端运行它并按你的意愿设置它。 You can enable logging, files are saved under the the TestResults folder in the same folder listed above, and you should be able to see your results. 您可以启用日志记录,文件保存在上面列出的同一文件夹中的TestResults文件夹下,您应该能够看到结果。 An example test run would look like: 示例测试运行如下:

vstest.console.exe D:\(Path To my Test)\(My Tests dll file).dll  /Settings:D:(Path tO my Tests)\(My Test settings file).testsettings /logger:trx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM