【问题标题】:Removing Standard Output Messages from Console Window从控制台窗口中删除标准输出消息
【发布时间】:2016-05-09 14:07:21
【问题描述】:

我正在使用 vstest 在本地执行测试。

"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe\" "C:\Debug\Solution.dll /Tests:VerifyTest1,VerifyTest2 /Logger:trx"

通过控制台我收到类似这样的输出 -

Passed   VerifyTest1
Failed   VerifyTest2
Standard Output Messages:

TestContext Messages:
1/29/2016 21:50:00  -  START  -  START : [VerifyTest2] 
   1/29/2016 21:50:00  -  INFO  -  Operating System - Microsoft Windows 10 Enterprise 
   1/29/2016 21:50:00  -  INFO  -  Test Environment - Test1 
   1/29/2016 21:50:00  -  INFO  -  Test Environment - Test1 
   1/29/2016 21:50:00  -  INFO  -  File updated 
   1/29/2016 21:50:02  -  INFO  -  Login Complete! via UI API's
   1/29/2016 21:50:03  -  INFO  -  eb481527-49f6-49bc-a9ca-9ccf4e10d12a submitted successfully.
   1/29/2016 21:50:11  -  PASS  -  Return created through UI
   1/29/2016 21:50:11  -  INFO  -  Checking Process launched or NOT
   1/29/2016 21:50:11  -  INFO  -  Process: My.CommonUIFramework.Shell is launched
   1/29/2016 21:50:11  -  INFO  -  Terminating the Process: My.CommonUIFramework.Shell
   1/29/2016 21:50:11  -  INFO  -  Checking Process launched or NOT
   1/29/2016 21:50:11  -  INFO  -  Process: My.Xion.DataMigration.UI is NOT launched
   1/29/2016 21:50:12  -  INFO  -  Launched the Application : My.CommonUIFramework.Shell
   1/29/2016 21:50:12  -  INFO  -  Checking Process launched or NOT 

现在,当控制台上的测试失败时,我不希望调试跟踪包含所有信息。我只想在控制台上通过或失败结果。有没有办法做到这一点。我知道我可以在 trx 文件上看到结果,但我只是想知道有没有办法在控制台上抑制调试跟踪或标准输出消息。

【问题讨论】:

    标签: coded-ui-tests vstest


    【解决方案1】:

    您可能希望禁用跟踪日志。您可以通过多个渠道进行操作。根据您的 VSTS 和 .Net 版本,按照此处所述尝试。 https://msdn.microsoft.com/en-us/library/jj159363(v=vs.120).aspx

    0 是禁用跟踪的设置。

    【讨论】:

      【解决方案2】:

      使用 MSTest 而不是 VSTest 解决了我的问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-08-24
        • 2010-10-21
        • 2015-02-11
        • 1970-01-01
        • 2011-12-01
        相关资源
        最近更新 更多