NUnit Test with WatiN works fine with Dev10, but when NUnit started with "C: \ Program Files (x86) \ NUnit 2.5.5 \ bin \ net-2.0 \ nunit.exe"

I have the following code in a 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();

By right-clicking on a project in Dev10 (visual studio 10) and selecting [Test With] [NUnit 2.5], this test code works without problems. I have TestDriven installed. When you open NUnit from C: \ Program Files (x86) \ NUnit 2.5.5 \ bin \ net-2.0 \ nunit.exe "and then open my test dll, the following text is reported to NUnit. Errors and crashes

... LoginAsWellKnownUserShouldSucceed:
System.Runtime.InteropServices.COMException : Error HRESULT E_FAIL has been returned from a call to a COM component.

... cs Dev10 Run Test,... . TechTalk.SpecFlow 1.3, NUnit 2.5.5.10112, Watin 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, , NUnit 2.5.5 TestDriven, NUnit 2.5.5 Dev10 TestDriven?

+3
3

NUnit admin. Dev10 , w3ww, TestDriven . NUnit , COM- . , , hello-world exmaple google Watin , NUnit admin. NUNit + Watin + -, NUnit com.

+1
0

MSTest, Refresh, , :

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

Source: https://habr.com/ru/post/1745968/


All Articles