I tried installing SpecRun via Nugget. When I run my features, I obtain the following error:
[ERROR] Get to the Contact Page: The CurrentThread needs to have it's ApartmentState set to ApartmentState.STA to be able to automate Internet Explorer.
System.Threading.ThreadStateException: The CurrentThread needs to have it's ApartmentState set to ApartmentState.STA to be able to automate Internet Explorer. at WatiN.Core.IE.CheckThreadApartmentStateIsSTA() at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, IDialogHandler logonDialogHandler, Boolean createInNewProcess) at WatiN.Core.IE..ctor()
Any ideas how to fix this?
Additional Information:
Research
According to http://watin.org/documentation/sta-apartmentstate/, you need to set the Thread.Apartmentstate to STA when using WatiN. However, in order to use a test runner that has not been mentioned in the previous link, you need to email them (email already sent).
My App.config has the following:
<specFlow>
<!-- For additional details on SpecFlow configuration options see https://github.com/techtalk/SpecFlow/wiki/Configuration -->
<unitTestProvider name="SpecRun" runtimeProvider="TechTalk.SpecRun.SpecFlowPlugin.SpecRunRuntimeProvider, TechTalk.SpecRun.SpecFlowPlugin" generatorProvider="TechTalk.SpecRun.SpecFlowPlugin.Generator.SpecRunGeneratorWith, TechTalk.SpecRun.SpecFlowPlugin.Generator" />
<trace traceTimings="false" listener="TechTalk.SpecRun.SpecFlowPlugin.SpecRunListener, TechTalk.SpecRun.SpecFlowPlugin" />
</specFlow>