Watin C# NUnit IE COM Exception

1

I use Watin and Nunit for testing, All works fine on Windows 7. But now I need to share my test on a server Windows 2008. And It's a problem because I always get an exception when I try to Logout and then launch a new IE: System.Runtime.InteropServices.COMException (0x800704A6): Creating an instance of the COM component with CLSID {0002DF01-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 800704a6. at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, IDialogHandler logonDialogHandler, Boolean createInNewProcess)

I try to update IE to IE 9, same problem I try to add some System.Threading.Thread.Sleep(4000), same problem. I get this exception on this line:

return new IE(Config.DefaultConfig.HomepageUrl);

Thanks for your help,

Jerome

internet-explorer
nunit
watin
asked on Stack Overflow Jan 10, 2012 by Jerome2606

2 Answers

3

I believe I had the same problem a while ago, but can't remember the exact solution so here is a couple of thinks you can try:

  1. Did you add a reference to Interop.SHDocVw and Microsoft.mshtml?
  2. And in their properties have you set Embed Interop Types to False?

Hope it helps. If some solution pops into my head I'll let you know.

answered on Stack Overflow Jan 10, 2012 by t3hn00b
0

I found a way to don't have anymore this message:

return new IE(Config.DefaultConfig.HomepageUrl, true);

To launch in a new process And I add some

System.Threading.Thread.Sleep(4000); 

When Watin need to AttachBrowser.

But the problem is that now I get some COMException:

The object invoked has disconnected from its clients. (HRESULT: 0x80010108 RPC E DISCONNECTED)

this last message appear when I close a IE popup window. It don't find my mainpage after I close this popup window.

Thanks for your help,

Jerome

answered on Stack Overflow Jan 11, 2012 by Jerome2606

User contributions licensed under CC BY-SA 3.0