NUnit使用WatiN进行测试,从Dev10开始运行正常,但当NUnit从";C:\ProgramFiles(x86)\NUnit 2.5.5\bin\net-2.0\NUnit.exe;

NUnit使用WatiN进行测试,从Dev10开始运行正常,但当NUnit从";C:\ProgramFiles(x86)\NUnit 2.5.5\bin\net-2.0\NUnit.exe;,nunit,watin,comexception,specflow,Nunit,Watin,Comexception,Specflow,我在Nunit测试中有以下代码 string url = ""; url = @"http://localhost/ClientPortalDev/Account/LogOn"; ieStaticInstanceHelper = new IEStaticInstanceHelper(); ieStaticInstanceHelper.IE = new IE(url); ieStaticInstanceHelper.IE.TextField(Find.ByI

我在Nunit测试中有以下代码

    string url = "";
    url = @"http://localhost/ClientPortalDev/Account/LogOn";
    ieStaticInstanceHelper = new IEStaticInstanceHelper();
    ieStaticInstanceHelper.IE = new IE(url);
    ieStaticInstanceHelper.IE.TextField(Find.ById("UserName")).TypeText("abc");
    ieStaticInstanceHelper.IE.TextField(Find.ById("Password")).TypeText("defg");
    ieStaticInstanceHelper.IE.Button(Find.ById("submit")).Click();
    ieStaticInstanceHelper.IE.Close();
在Dev10(visualstudio10)中右键单击项目并选择[Test With][NUnit 2.5]时,此测试代码将毫无问题地运行。我已经安装了testdrive。 从C:\Program Files(x86)\NUnit 2.5.5\bin\net-2.0\NUnit.exe“打开NUnit,然后打开我的测试dll时,NUnit错误和失败中会报告以下文本

... LoginAsWellKnownUserShouldSucceed:
System.Runtime.InteropServices.COMException : Error HRESULT E_FAIL has been returned from a call to a COM component.
另外,右键单击Dev10中的源cs文件并选择RunTest,…也可以工作。 上述测试实际上是TechTalk.SpecFlow 1.3步骤的一部分,我安装了NUnit 2.5.5.10112,我安装了Watin 20.20, 我的测试dll有以下App.config
开始尖括号已被删除…如何让xml显示在中

configuration>
  configSections>
    sectionGroup name="NUnit">
      section name="TestRunner" type="System.Configuration.NameValueSectionHandler"/>
    /sectionGroup>
  /configSections>
  NUnit>
    TestRunner>
      add key="ApartmentState" value="STA" />
    /TestRunner>
  /NUnit>
  appSettings>
    add key="configCheck" value="12345" />
  /appSettings>
/configuration>
以前有人打过这个吗?
NUnit测试显然是在TestDriven的NUnit 2.5.5中运行的,但在从Dev10和TestDriven外部运行NUnit 2.5.5时则不是这样?

以管理员身份在NUnit中运行测试。 我以管理员的身份运行Dev10,以便能够连接和调试w3ww,这就是TestDriven测试工作的原因。 当我开始以管理员身份运行NUnit时,COM服务器isue问题就消失了。 更让人困惑的是,在Watin网站上运行hello world exmaple对抗google是可行的,即使NUnit不是以管理员身份运行。

要对本地web服务器使用NUNit+Watin+,以管理员身份运行NUNit可以解决com服务器异常问题。

尝试在测试代码中使用属性而不是配置文件。

我正在使用MSTest,请调用Refresh以避免缓存数据,这对我有效:

browser.Refresh();
browser.TextField(Find.ById("username")).TypeText("user");
browser.TextField(Find.ById("password")).TypeText("pass");
browser.Button(Find.ByName("SUBMIT")).Click();

Dev10=VisualStudio10;我仍在进行此项工作;TestDriven使用nunit-x86而不是nunit.exe;还参与删除所有IE加载项;还参与获取watin的IE,我认为这是真正的问题-它非常…不可靠…向前…+1作为管理员运行,在将IE作为nunit te的一部分进行自动化时,也为我工作sts。