NUnit Test with WatiN, runs OK from and Dev10, But not from starting NUnit from "C:\Program Files (x
Posted
by judek.mp
on Stack Overflow
See other posts from Stack Overflow
or by judek.mp
Published on 2010-05-18T12:06:51Z
Indexed on
2010/05/18
12:10 UTC
Read the original article
Hit count: 783
I have the following code in an Nunit test ...
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();
On right-clicking the project in Dev10 and choosing [Test With][NUnit 2.5], this test code runs with no problems ( Iahve TestDriven installed ...)
When opening the NUnit from C:\Program Files (x86)\NUnit 2.5.5\bin\net-2.0\nunit.exe" and then opening my test dll, the following text is reported in NUnit Errors and failures ...
Elf.Uat.ClientPortalLoginFeature.LoginAsWellKnownUserShouldSucceed:
System.Runtime.InteropServices.COMException : Error HRESULT E_FAIL has been returned from a call to a COM component.
As an Aside ... Right-Clicking the source cs file in Dev10 and choosing Run Test, ... works as well.
The above test is actually part of TechTalk.SpecFlow 1.3 step, I have NUnit 2.5.5.10112, installed, I have Watin 20.20 installed,
I have ... & in my NUnit.exe.config
and I have the following App.config for my test dll... (the start angle brakets habe beem removed )
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>
Anyone hit this before ? The NUnit test obviously runs in NUnit 2.5.5 of TestDriven but not when run outside of Dev10 and TesDriven ?
© Stack Overflow or respective owner