I would like to use SpecRunner along with the library 'Baseclass.Contrib.SpecFlow.Selenium.NUnit.' When I added SpecRunner for SpecFlow 2 from Manage Nuget Packages, the unit test provider was 'SpecRun' in app.config. Then when added to 'Baseclass.Contrib.SpecFlow.Selenium.NUnit' to the solution using Manage Nuget Package, it also added a unit test provider of 'SeleniumNUnit. When I created my feature files and step definitions and tried to run the tests with each feature annotated with a browser tag like '@Browser: Chrome' and use the 'Browser.Current' syntax as the webdriver in my binding methods, it gave me an error. The error was first that I had two unit test providers in the app.config, and that the app.config can only have one unit test provider. SO I commented out the first unit test provider, and received another set of errors:
*Error 2 #error: 'Generation error: Could not load file or assembly 'TechTalk.SpecFlow, Version=1.9.0.77, Culture=neutral, PublicKeyToken=0778194805d6db41' or one of its dependencies. The system cannot find the file specified.' C:\Users\amaddox\documents\visual studio 2013\Projects\SpecFlow\SpecFlow\SpecFlowFeature1.feature.cs 1 8 SpecFlow *
*Error 33 Custom tool error: Generation error: Could not load file or assembly 'TechTalk.SpecFlow, Version=1.9.0.77, Culture=neutral, PublicKeyToken=0778194805d6db41' or one of its dependencies. The system cannot find the file specified. C:\Users\amaddox\documents\visual studio 2013\Projects\SpecFlow\SpecFlow\SpecFlowFeature1.feature 2 2 SpecFlow *
So then I tried to uncomment the first and comment the second unit test provider. Same issue. How can I run SpecRun in visual Studio 2015 along with the flexibility of parameterized cross browser tests functionality that 'Baseclass.Contrib.SpecFlow.Selenium.NUnit.Bindings' has to offer? It appears that it wants me to go back to a previous version of Specflow (1.9) and I am using Specflow 2. Not sure how to do this. How do I solve this issue?
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
<section name="autofac" type="Autofac.Configuration.SectionHandler, Autofac.Configuration" /></configSections>
<specFlow>
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config --><!-- use unit test provider SpecRun+NUnit or SpecRun+MsTest for being able to execute the tests with SpecRun and another provider --><unitTestProvider name="SpecRun" /><plugins>
<add name="SpecRun" />
<add name="Baseclass.Contrib.SpecFlow.Selenium.NUnit" path="..\packages\Baseclass.Contrib.SpecFlow.Selenium.NUnit.1.3.1\tools" /></plugins><unitTestProvider name="SeleniumNUnit" /><stepAssemblies>
<stepAssembly assembly="Baseclass.Contrib.SpecFlow.Selenium.NUnit.Bindings" />
</stepAssemblies></specFlow>
<appSettings>
<add key="seleniumBaseUrl" value="http://localhost:58909" />
</appSettings><autofac>
<components>
<component name="IE" type="OpenQA.Selenium.IE.InternetExplorerDriver, WebDriver" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
</component>
<component name="Chrome" type="OpenQA.Selenium.Chrome.ChromeDriver, WebDriver" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
</component>
<component name="Firefox" type="OpenQA.Selenium.Firefox.FirefoxDriver, WebDriver" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
</component>
<!-- Example of using an injected RemoteDriver:
<component
name="IE"
type="Baseclass.Contrib.SpecFlow.Selenium.NUnit.RemoteWebDriver, Baseclass.Contrib.SpecFlow.Selenium.NUnit.SpecFlowPlugin"
service="OpenQA.Selenium.IWebDriver, WebDriver"
instance-scope="per-dependency">
<parameters>
<parameter name="url" value="http://127.0.0.1:4444/wd/hub" />
<parameter name="browser" value="InternetExplorer">
</parameter>
</parameters>
</component>-->
</components>
</autofac>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="TechTalk.SpecFlow" publicKeyToken="0778194805d6db41" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
*