I'm trying to launch nunit ui tests with nant and get the error:
Buildfile: file:///c:/UItests/nant.build Target framework: Microsoft .NET Framework 4.0 Target(s) specified: build
build:
[nunit2] 2012/06/20/13:29:52: Exception in set up method: The CurrentThread needs to have it's ApartmentState set to Apar tmentState.STA to be able to automate Internet Explorer. [nunit2] 2012/06/20/13:29:52: Exception in set up method: The CurrentThread needs to have it's ApartmentState set to Apar tmentState.STA to be able to automate Internet Explorer. [nunit2] 2012/06/20/13:29:52: Exception in set up method: The CurrentThread needs to have it's ApartmentState set to Apar tmentState.STA to be able to automate Internet Explorer. [nunit2] 2012/06/20/13:29:52: Exception in set up method: The CurrentThread needs to have it's ApartmentState set to Apar tmentState.STA to be able to automate Internet Explorer.
[nunit2] 2012/06/20/13:29:52: Exception in set up method: The CurrentThread needs to have it's ApartmentState set to Apar tmentState.STA to be able to automate Internet Explorer.
I tried with App.config that comes with my project, like this:
<test assemblyname="UITests.dll" appconfig="UITests.dll.config" />
And also I created config file manually and put it to folder with test and nunit assemblies. But nothing helped. In config file I have:
<add key="ApartmentState" value="STA" />
Here is nant.build file:
<?xml version="1.0"?>
<project name="UITests" default="build">
<property name="build.dir" value="" />
<target name="build">
<nunit2>
<formatter type="Plain" />
<test assemblyname="${build.dir}UITests.dll" appconfig="UITests.dll.config" />
</nunit2>
</target>
</project>
What I missed?