Search code examples
nunitresharperwatin

Running WatiN tests with ReSharper testrunner


I'm getting started with WatiN to test my web interface. The problem I'm having is the following: When I start the tests from within TestDriven.net, I have no problem. If I use the ReSharper test runner, I get this predictable AppartmentState exception.

I tried using the different options described here: http://watin.sourceforge.net/apartmentstateinfo.html#testdriven. Nothing helps.

Any suggestions?


Solution

  • I've use Resharper test runner in most of my watin test projects. To get it to work use the same method as for nunit:

    http://watin.sourceforge.net/apartmentstateinfo.html#nunit

    App.config:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections>
        <sectionGroup name="NUnit">
          <section name="TestRunner" type="System.Configuration.NameValueSectionHandler"/>
        </sectionGroup>
      </configSections>
      <NUnit>
        <TestRunner>
          <!-- Valid values are STA,MTA. Others ignored. -->
          <add key="ApartmentState" value="STA" />
        </TestRunner>
      </NUnit>
    </configuration>