我的团队拥有一支由我们的团队服务器自动操作的WatiN测试套。 我们最近把我们的所有建筑代理人都转至64个轨道,我也把我们的WatiN测试改用X64模式的UNnit。 由于Interop呼吁失败,或出于其他原因,Watin总是给我们造成无法正常的测试失败,但总是非常少见。 由于把所有东西都转至64轨道,我们几乎所有的试验套案都因下列例外情况而失效:
Test(s) failed. System.InvalidCastException : Specified cast is not valid.
at SHDocVw.IWebBrowser2.get_HWND()
at WatiN.Core.Native.InternetExplorer.IEBrowser.get_hWnd()
at WatiN.Core.DomContainer.StartDialogWatcher()
at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, IDialogHandler logonDialogHandler, Boolean createInNewProcess)
...
我如何避免造成我检测经常失败的错误?
如果只是转而采用32个轨道模式,我可以处理此事,但我很想知道,没有更好的解决办法。 感谢。
UPDATE:
After leaving the jobs as using 64 bit NUnit runner for about 5+ runs of the test suites, they failed every time except once with this same error. We switched them back to 32 bit and have had 10+ successful runs since. I guess the temporary fix for now is use a 32 bit NUnit runner although I am still looking for a reason this happens or a solution that would allows us to switch back to x64.