문제

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

Edit: This occured when using the 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.

도움이 되었습니까?

해결책

You can click "Cancel" in Test Explorer:

enter image description here

Show Test Explorer by going to TEST > Windows > Test Explorer.

This is in Visual Studio 2013.

Instructions for other versions of VS can be found here

다른 팁

Sorry for waking up an old thread:) just wanted to share my solution here, I had the same issue on VS 2015. There is some text below the search input just where the cancel should appear (take a look at @Codeman print screen), the text is actually some description on how you can setup a build for your tests, the text is several lines and at the end you have "do not show this any more" just press it and then the cancel button appears:) Very strange bug, sorry I do not have some print screens of this hope it helps someone

VS2015. If the hanging tests are executables instead of DLLs you need to kill those tests in the task manager. 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. Visual Studio 2022 Professional version 17.2.3.

Terminate process on cancel screenshot

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top