2017-08-25 55 views
3

所以基本上,當我打開我的解決方案與nunit3 & specflow,在2017年VS(15.3.2)硒UI測試中,我得到的測試資源管理器窗口下面的異常和錯誤:VS 2017年的測試資源管理器窗口空引用異常

enter image description here

有沒有辦法解決這個問題?有一個工作,但它的可笑...如果我沒有任何項目啓動VS 2017,然後從最近開放項目 - 它的工作正常。

An exception was encountered while constructing the content of this frame. This information is also logged in "C:\Users\USER\AppData\Roaming\Microsoft\VisualStudio\15.0_6ae63cad\ActivityLog.xml". 

Exception details: 
System.NullReferenceException: Object reference not set to an instance of an object. 
    at Microsoft.VisualStudio.TestWindow.VsHost.TestWindowToolWindow.InvokeSwapInRealTestWindow(String eventName) 
    at Microsoft.VisualStudio.TestWindow.VsHost.TestWindowToolWindow.OnToolWindowCreated() 
    at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, UInt32 flags) 
    at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, ProvideToolWindowAttribute tool) 
    at Microsoft.VisualStudio.Shell.Package.FindToolWindow(Type toolWindowType, Int32 id, Boolean create, ProvideToolWindowAttribute tool) 
    at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Guid& toolWindowType, Int32 id) 
    at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsToolWindowFactory.CreateToolWindow(Guid& toolWindowType, UInt32 id) 
    at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent() 


ActivityLog.xml content: 

    <entry> 
    <record>678</record> 
    <time>2017/09/15 12:43:31.678</time> 
    <type>Error</type> 
    <source>VisualStudio</source> 
    <description>Construction of frame content failed.&#x000D;&#x000A;Frame identifier: ST:0:0:{e1b7d1f8-9b3c-49b1-8f4f-bfc63a88835d}&#x000D;&#x000A;Frame caption: Test Explorer&#x000D;&#x000A;Exception details:&#x000D;&#x000A;System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A; at Microsoft.VisualStudio.TestWindow.VsHost.TestWindowToolWindow.InvokeSwapInRealTestWindow(String eventName)&#x000D;&#x000A; at Microsoft.VisualStudio.TestWindow.VsHost.TestWindowToolWindow.OnToolWindowCreated()&#x000D;&#x000A; at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, UInt32 flags)&#x000D;&#x000A; at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, ProvideToolWindowAttribute tool)&#x000D;&#x000A; at Microsoft.VisualStudio.Shell.Package.FindToolWindow(Type toolWindowType, Int32 id, Boolean create, ProvideToolWindowAttribute tool)&#x000D;&#x000A; at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Guid&amp; toolWindowType, Int32 id)&#x000D;&#x000A; at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsToolWindowFactory.CreateToolWindow(Guid&amp; toolWindowType, UInt32 id)&#x000D;&#x000A; at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()</description> 
    </entry> 
+0

圖片的錯誤信息也沒有什麼幫助。請張貼實際的文字。請參閱https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-orrors – AdrianHHH

+0

也作爲文本添加。 – Rain9333

回答

1

如果您的測試瀏覽器着眼於啓動,則會出現此問題。 臨時解決方案是在關閉VisualStudio之前單擊另一個TAB(解決方案資源管理器),以便在啓動時不會將焦點放在TestExplorer上。

編號:https://developercommunity.visualstudio.com/content/problem/117601/test-explorer-nullreferenceexception-on-startup.html

+0

仍然不適合我。奇怪的是,我的第二個項目看起來沒問題(都使用Selenium和NUnit 3)。 – Rain9333

0

的問題似乎是固定的(至少我不能再重現)與VS2017更新15.4.1

相關問題