I'm currently trying to use Selenium Grid 2 to run automation tests on multiple browsers. During my research I came across using Baseclass.Contrib.Specflow which enables me to use the browsers as tags in the feature files without having to declare it in my main driver class. The problem I have is that one of the blogs I read had the following as the set up code
[SetUp]
public void Test_Setup(){
CurrentDriver = Browser.Current;}
My app config file looks contains the following:
<components>
<!-- <component name="Firefox" type="OpenQA.Selenium.Firefox.FirefoxDriver, WebDriver" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
</component>-->
<component name="Firefox"
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://localhost/wd/hub" />
<parameter name="browser" value="Firefox" />
</parameters>
</component>
<component name="Safari" 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://localhost/wd/hub" />
<parameter name="desiredCapabilities" value="Chrome" />
</parameters>
</component>
I get an error when I try to run the script using the above Setup method.
Error:
System.Collections.Generic.KeyNotFoundException : The given key was not present in the dictionary
The blog I got this solution from doesn't seem to answer questions regarding to this so I'm a bit desperate. This will basically allow me to to the following on the feature file and get tests to run based on the tag
@Browser:Firefox
@Browser:Chrome
Hope this is enough information to give me advice.