简体   繁体   English

测试挂起时如何停止 Visual Studio 测试运行程序

[英]How can I stop the Visual Studio Test Runner when a test hangs

When a test hangs in a loop, the small green progress bar in the test runner does not proceed, but there is no way to stop the test run.当测试在循环中挂起时,测试运行器中的绿色小进度条不会继续,但无法停止测试运​​行。 Or is there?或者有吗?

VS 2013对比 2013

Edit: This occured when using the XUnit TestRunner .编辑:这发生在使用XUnit TestRunner时。 The Cancel button simply did not show up.取消按钮根本没有出现。 After testing various test runners in a new solution, it turned out, that it works with all of them.在新解决方案中测试了各种测试运行程序后,结果证明它可以与所有这些运行程序一起使用。 Finally it also worked with my original solution.最后它也适用于我原来的解决方案。 So there was some anomaly in the state of my VS environment that caused cancel to disapper.因此,我的 VS 环境状态出现了一些异常,导致取消消失。

You can click "Cancel" in Test Explorer:您可以在测试资源管理器中单击“取消”:

在此处输入图像描述

Show Test Explorer by going to TEST > Windows > Test Explorer.通过转到 TEST > Windows > Test Explorer 来显示测试资源管理器。

This is in Visual Studio 2013.这是在 Visual Studio 2013 中。

Instructions for other versions of VS can be foundhere其他版本的 VS 的说明可以在这里找到

很抱歉唤醒了一个旧线程:) 只是想在这里分享我的解决方案,我在 VS 2015 上遇到了同样的问题。搜索输入下方有一些文本,就在取消应该出现的位置(看看@Codeman 打印屏幕) ,文本实际上是关于如何为测试设置构建的一些描述,文本是几行,最后你有“不再显示这个”只需按下它然后出现取消按钮:) 很奇怪错误,对不起,我没有这个的一些打印屏幕希望它可以帮助某人

VS2015. VS2015。 If the hanging tests are executables instead of DLLs you need to kill those tests in the task manager.如果挂起的测试是可执行文件而不是 DLL,则需要在任务管理器中终止这些测试。 You need to close the Test Explorer Window to prevent automatic running.您需要关闭测试资源管理器窗口以防止自动运行。 While the tests are running/hanging you will not be able to compile the according project.在测试运行/挂起时,您将无法编译相应的项目。

For me the solution was to go to Task Manager, locate chromedriver and end the task.对我来说,解决方案是转到任务管理器,找到 chromedriver 并结束任务。 Visual Studio 2022 Professional version 17.2.3. Visual Studio 2022 专业版 17.2.3。

在取消屏幕截图时终止进程

I have found the solution to this issue.我已经找到了解决这个问题的方法。 To stop the run after cancel is pressed, just set the 'Terminate process on cancel' option to True.要在按下取消后停止运行,只需将“取消时终止进程”选项设置为 True。

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

相关问题 如何在Visual Studio Test Runner中排除某些测试? - How to exclude certain tests in the Visual Studio Test Runner? 如何在tfs构建脚本中指定Visual Studio测试运行程序 - How do i specify Visual Studio test runner in tfs build script VS Test Runner在Visual Studio Online上运行缓慢 - VS Test Runner is slow on Visual Studio Online 如何在Visual Studio 2017 15.6.0中调试单元测试 - How can I debug unit test in Visual Studio 2017 15.6.0 如何在Visual Studio 2010中精确计算测试时间 - How can I precisely time a test run in visual studio 2010 如何在Visual Studio测试项目中使用Ninject - How can I use Ninject in a Visual Studio test project Visual Studio 2010如何在运行测试时停止执行路径的更改 - Visual Studio 2010 How to stop Change of Execution Path when running a Test 如何使用Visual Studio Test中的资源文件中的特定异常消息测试预期的异常? - How can I test for an expected exception with a specific exception message from a resource file in Visual Studio Test? 从maven运行测试时,如何查看IntelliJ IDEA“测试运行器选项卡”? - How can I view the IntelliJ IDEA “Test Runner Tab” when running tests from maven? 在使用Resharper测试运行器时,如何在我的qunit测试中设置断点 - How can I set breakpoints in my qunit tests when using the Resharper test runner
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM