Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ASP.NET单元测试-WatiN和Windows 7/Internet Explorer 8_.net_Unit Testing_Internet Explorer_Automation_Watin - Fatal编程技术网

ASP.NET单元测试-WatiN和Windows 7/Internet Explorer 8

ASP.NET单元测试-WatiN和Windows 7/Internet Explorer 8,.net,unit-testing,internet-explorer,automation,watin,.net,Unit Testing,Internet Explorer,Automation,Watin,让WatiN在Win7/IE8上运行有什么诀窍吗 我的代码: browser = new IE(); browser.GoTo("http://testserver"); browser.TextField(Find.ByName("txtUser")).TypeText("tyndall"); 第三行从未真正运行过,我得到了一个错误: System.Runtime.InteropServices.COMException:RPC服务器不可用。(来自HRESULT的异常

让WatiN在Win7/IE8上运行有什么诀窍吗

我的代码:

    browser = new IE();
    browser.GoTo("http://testserver");
    browser.TextField(Find.ByName("txtUser")).TypeText("tyndall");
第三行从未真正运行过,我得到了一个错误:

System.Runtime.InteropServices.COMException:RPC服务器不可用。(来自HRESULT的异常:0x800706BA)


第二条线似乎在运行。IE8出现并被导航到正确的URL。

以管理员身份运行Visual Studio为我解决了此问题。(带WatiN 2.0.20的Visual Studio 2008)。

避免以管理员身份运行Visual Studio或NUnit的另一种选择是在机器级别禁用UAC,如果您以最少的权限(您应该是这样)运行,这不应该是安全问题。

在win 7 sp1中
降低用户配置管理中的安全级别

重新启动计算机 windows更新妨碍了实例化新的COM对象

有关更多详细信息,请参见我对该问题的回答:


在关闭IE并打开“开发人员工具”窗格后,我开始遇到同样的异常:“System.Runtime.InteropServices.COMException:RPC服务器不可用。”


点击F12关闭开发者窗格,并确保每当您关闭IE时它都已关闭(IE会记住启动时的状态)。

您使用的是哪个版本的WatiN?最新的官方版本(1.3.0)不适用于IE8,但2.0 RC应该可以。Internet Explorer 8.0.7600.16385我收到了一个类似的错误:System.Runtime.InteropServices.COMException:请求的资源正在使用中。在WatiN.Core.Native.InternetExplorer.IEBrowser.NavigateTo(Uri URL)WatiN.Core.Browser.GoTo(Uri URL)WatiN.Core.Browser.GoTo(字符串URL)不知怎的错过了SP1补丁吗?你是说Windows用户安全屏幕对吗?我要试一试+1+1; 我关闭了UAC,将用户添加到管理员组,WatiN测试开始在我的构建代理上工作。在本地工作,您知道如何在TeamCity中实现这一点吗?如果任何应用程序出现错误,请使用管理员运行,而不仅仅是visual studio