我的代碼如下NUnit測試...NUnit使用WatiN進行測試,從Dev10運行正常,但是當NUnit從「C: Program Files(x86) NUnit 2.5.5 bin net-2.0 nunit.exe」啓動時
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項目(視覺工作室10),選擇[測試用] [NUnit的2.5],這個測試代碼,沒有任何問題上運行。我安裝了TestDriven。 當從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.
Aside Aside ...右鍵單擊Dev10中的源代碼cs文件並選擇Run Test,運行測試... 上述測試實際上是TechTalk.SpecFlow 1.3步驟的一部分,我有NUnit 2.5。 5.10112,安裝,我已經安裝了華廷20.20, 我有以下App.config中爲我的測試DLL
開始尖括號已被刪除...你如何獲得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時不會運行?
嗯...是什麼DEV10? – 2010-05-18 12:12:55
Dev10 = VisualStudio10;我仍在努力通過這一個; TestDriven使用nunit-x86而不是nunit.exe;也玩刪除所有的IE插件;也玩弄了用於watin的IE,我認爲這是真正的問題 - 這是非常...不可靠的... ... – user206890 2010-05-19 20:34:59