43

For some reason I can't open the test explorer window in Visual Studio 2012. I click Test->Windows->Test Explorer and nothing happens...

This problem may have been caused by recently uninstalling DotCover. I did this because my licence expired and I was having issues running tests without it (context menus weren't working).

Any suggestions or advice much appreciated!

Thanks.

Mohsin Awan
  • 1,176
  • 2
  • 12
  • 29
WheretheresaWill
  • 5,882
  • 7
  • 30
  • 43
  • Hmm, the plot thickens... If I set a break point in a test and then right-click->debug tests then the test explorer window appears until the test completes, and then it disappears again. And pinning it, unpinning it, docking/undocking it does not keep it in view! – WheretheresaWill Jul 12 '13 at 10:41
  • I am seeing this behavior too. I did not uninstall anything. I have removed all my .suo files. I really do not want to go the reset settings route (painful). Any other ideas? I am going to post this problem on connect.microsoft.com site to see if the company itself will respond. – Tevya Aug 08 '13 at 17:26
  • Sorry but I've got no suggestions other than the heavy-handed 'reset all' method below. It wasn't too much of a big deal though, just reverting my tab and newline settings and some code highlighting colour choices... You may have more customisations though! – WheretheresaWill Aug 09 '13 at 08:47

9 Answers9

41

In VS2012, Test Explorer has a bug in that the window doesn't get focus when you click Test > Windows > Test Explorer. Instead, the menu item has no effect unless the window was complete hidden, in which case it is displayed.

The bug means that if Test Explorer is collapsed with Auto Hide, the menu item does nothing. Check that Test Explorer isn't in an auto-hide tab somewhere off to the left or right (i.e. in a tab with text written vertically, like Server Explorer and Toolbox are by default).

Update: The bug is fixed in VS2013.

Edward Brey
  • 40,302
  • 20
  • 199
  • 253
  • I've actually seen this problem since - good suggestion! I've beeb trying to find text explorer and it's just been hidden amongst a million tabs. Silly I know, but quite often happens when you drag the window around and it snaps back into VS without you realising. – WheretheresaWill Nov 11 '13 at 11:28
  • @WheretheresaWill: I had a similar experience when I was trying to demonstrate the concept of unit testing to a client who was new to automated unit tests in general and test managers in particular. I wanted to pop open Test Explorer and show him how easy it was to start the tests and see the pretty green check marks. Instead it was, "Take a look at this. Oh, never mind." It was getting to that bottom of the problem that lead me to this SO question. – Edward Brey Nov 11 '13 at 12:19
  • encountered this problem in VS2013 (Window->Reset Window Layout fixed the problem for me) – George Dec 12 '14 at 16:07
16

Window -> Reset Window Layout fixed the problem for me.

Heather
  • 2,602
  • 1
  • 24
  • 33
  • This got me in the direction of my silly problem of having my laptop opened (enabling an extra screen) while using my dock with other monitors. The test window was going to my laptop screen which wasn't in my line of sight. Thanks! – patrickbadley Oct 14 '20 at 21:14
11

For me the fix was:

  • Focus on the test window by Test > Windows > TestExplorer
  • Using Win+Left / Right to move the window onto an active screen

    >    ┌┬┐
    > Win├┼┤ + Left or Right key
    >    └┴┘
    

The same worked for the ReSharper Unit Test Sessions window.

Ruskin
  • 5,721
  • 4
  • 45
  • 62
  • 3
    It's 2019 ( 4 yrs later ). I just wasted hours of my time debugging until I tried this. – kervin Oct 25 '19 at 14:22
  • @kervin you're the second person in the last couple of weeks who has up-voted this ... looks like there's a regression in VS2019 ... I'll ping MS – Ruskin Oct 28 '19 at 03:16
  • logged at https://developercommunity.visualstudio.com/content/problem/795674/regression-test-window-off-screen.html – Ruskin Oct 28 '19 at 03:30
3

Found this solution here, which is the only thing that worked for me.

Delete all files from this folder: user\AppData\Local\Microsoft\VisualStudio\11.0\ComponentModelCache

Cody Stott
  • 484
  • 1
  • 7
  • 19
1

As a brutal fix I actually decided to reset all VS settings (not ideal as you lose all your custom settings like formatting and debugging preferences!).

To do this open up a cmd line and cd to the VS directory (mine was C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE) and type:

devenv.exe /ResetSettings

Hope this helps someone in the future...

WheretheresaWill
  • 5,882
  • 7
  • 30
  • 43
1

I had the same problem; turned out it was the Corbis Route add-in that was causing an error in combination with the 'I hate regions' add-on, which caused the Test Window to throw an exception.

After removing both add-ins the window reappeared again after a reset of the VS 2013 window layout. (Windows > Reset Window Layout)

MartijnK
  • 642
  • 5
  • 19
1

This worked for me (VS2015):

  1. Close VS instances.

  2. Delete component model cache folder %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache . This wipes out the MEF cache.

  3. Run devenv /setup /ResetSkipPkgs ref. http://msdn.microsoft.com/en-US/library/ex6a2fad(v=VS.80).aspx

  4. Start VS again and see if the problem goes away.

Source

Daniel Fisher lennybacon
  • 3,865
  • 1
  • 30
  • 38
O.O
  • 11,077
  • 18
  • 94
  • 182
0

A short-cut for those who have lost Test Explorer somewhere !

  1. Ctrl + Q (for quick launch)
  2. You would notice the focus on a small text box on the top right of VS.
  3. Type in "Test Explorer" and select the option that says Test> Windows> Test Explorer
Farax
  • 1,447
  • 3
  • 20
  • 37
0

I have VS 2015. I couldn't find my Test Explorer, even with Test->Windows->Test Explorer. I finally figured it was showing on the left instead of the right.

Michele
  • 3,617
  • 12
  • 47
  • 81