Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 751
grootjans Avatar asked Mar 14 '26 11:03

grootjans


1 Answers

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>
like image 69
Edward Wilde Avatar answered Mar 16 '26 07:03

Edward Wilde



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!