ASP.NET Unit Testing - WatiN and Windows 7 / Inter

2019-05-07 14:24发布

Any tricks in getting WatiN to run on Win7/IE8?

My code:

    browser = new IE();
    browser.GoTo("http://testserver");
    browser.TextField(Find.ByName("txtUser")).TypeText("tyndall");

The third line never really runs and I get an error back:

System.Runtime.InteropServices.COMException : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

The second line seems to run. IE8 appears and is navigated to the correct URL.

5条回答
狗以群分
2楼-- · 2019-05-07 14:33

Reboot the machine

There are windows updates getting in the way of instantiating new COM objects.

See my answer on this question for more details:

WatiN, NUnit and CruiseControl.NET-- Error message 800704a6

查看更多
Deceive 欺骗
3楼-- · 2019-05-07 14:35

Running Visual Studio as Administrator solved this problem for me. (Visual Studio 2008 with WatiN 2.0.20).

查看更多
你好瞎i
4楼-- · 2019-05-07 14:35

I started to get the same exceptions: "System.Runtime.InteropServices.COMException : The RPC server is unavailable." after closing IE while the Developer Tools pane was open.

Hit F12 to close the developer pane and make sure it is closed whenever you close IE (IE remembers the state when starting).

查看更多
Anthone
5楼-- · 2019-05-07 14:37

in win 7 sp1
reduce security level in user configuration managment

查看更多
SAY GOODBYE
6楼-- · 2019-05-07 14:58

The other alternative to avoid running Visual Studio or NUnit as an admin would be to disable UAC at a machine level, which shouldn't be a security issue if you are running with least privileges (which you should be).

查看更多
登录 后发表回答