specrun


Running Specrun and using 'Baseclass.contrib.Specflow' for cross browser parameterized tests in VS2015


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>
*
After a short look at Baseclass.Contrib.SpecFlow.Selenium.NUnit it depends on SpecFlow 1.9. If you want to use it, you have to stick on SpecFlow 1.9.
Additionally it looks like they create their own GeneratorPlugin to generate custom code behind files.
That does not work together with SpecFlow+Runner as it has its own generator.
And two unitTestProviders in the config does not work.
But the SpecFlow+Runner has a feature called "Targets" see http://www.specflow.org/plus/documentation/SpecFlowPlus-Runner-Profiles and search for it there.
You can create a target for each of your browsers and use the ConfigFileTransformation Step to adjust your config for your different browsers.
Another way, but I am not sure if this work. SpecFlow+Runner has support for SpecFlow 1.9 and can execute NUnit tests.
Use the SpecRun.SpecFlow.1-9-0 nuget package and configure the unitTestProvider to the one of baseClass. If they generate the standard NUnit attributes, the SpecFlow+Runner should find the tests and can execute them. But be aware, that you are losing some features with that method.
Full disclosure: I am one of the developers of SpecFlow and SpecFlow+
I rewrote Baseclass.Contrib.SpecFlow.Selenium.NUnit for 2.1 support.
New codebase, #ignore tag support for nunit3 and several testing services like BrowserStack, SauceLabs, TestingBot.

Related Links

How to specify feature with feature's path in SpecRun?
Specrun Command Line Filter by name of feature
Running Specrun and using 'Baseclass.contrib.Specflow' for cross browser parameterized tests in VS2015
SpecRun not integrating tests in Visual Studio 2012

Categories

HOME
ibm-bluemix
amazon-ec2
omnet++
openstack
google-play
view
hashmap
grep
binary-tree
windows-server
gnupg
vifm
offline
visual-studio-cordova
decomposition
jsprit
dosgi
graphlab
jsdoc
google-cloud-speech
textfield
grails3
conemu
amazonsellercentral
zapier
jquery-ajaxq
mmap
tibco-mdm
p-value
angular2-aot
traffic
greendao
procdump
unboundid
oracle-fusion-middleware
kendo-ui-grid
webtest
stringtemplate
protovis
repo
form-data
io-redirection
lto
starteam
graphenedb
android-tabhost
sfdc
android-mediaprojection
spring-security-kerberos
nxlog
isbn
gpx
chain-builder
clean-architecture
yii2-extension
crypt
flow-control
sqldf
spring-mongodb
spring-cache
specrun
migradoc
word-vba-mac
gridpane
savon
phishing
firebaseui
nessus
revolution-r
unity-networking
teamcity-8.0
qdialog
kcachegrind
android-listview
myo
event-bubbling
graph-api-explorer
skos
block-device
modalpopup
gui-test-framework
mdt
java-metro-framework
internet-connection
googlemock
onactivityresult
mechanize-ruby
rtmfp
java.nio.file
ril
spring-validator
distutils
typoscript2
coderush
propertyeditor
hosts-file
onsubmit
boost-filesystem
window-management
infobox
disclosure
datareader
remember-me
filtered-index
ncqrs
gacutil
geneva-server
multiple-languages

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App