Is there a way to parameterize the feature and run it multiple times in specflow without using runner
I would like to run a feature on multiple browsers and I had a post before regarding having parameter on the feature level in order to run the scenarios under the feature multiple times. The answer was to use speclow+runner but since I need to activate it on every machine was wondering if there is an alternative for that. Is there a way to achieve that without using runner?
-
Hi Khaled, are you running your tests with the SpecFlow+ Runner on a build agent? If so usually we detect that and you don't need to activate the SpecFlow+ Runner on the agent.
If you are using NUnit and Selenium you can try to follow this step-by-step tutorial here: How To Perform Parallel Execution With Specflow, NUnit, and Selenium (lambdatest.com)
Let me know if that helps
0 -
Hello Mario,There is a repo where the code reside and there is a jenkins pipeline that run the code on different machines to generate the dlls. I even tried installing the runner on my machine but didn't see any activation link. Is it bcs I have Specflow.nunit installed and some other nuget packages as selenium? Another thing is that someone suggested using External Data plugin. I am trying to install the nuget package Specflow.ExternalData version 3.9.8 but When I rebuild the solution, I get the error: "GenerateFeatureFileCodeBehindTask" task failed unexpectedly". I have Specflow 3.9.8 installed in addition to specflow.Nunit, Selenium.chrome.webdriver, selenium.support and selenium.webdriver. Not sure how to fix this issue.0
-
Actually I was able to use the External Data but I was able to do that only on the scenario not on the feature level. I defined a json file with some properties let us say as follows:
{ "E-mail addresses": { "Valid" :{ "Simple": "email@domain.com", "Dot in the address": "firstname.lastname@domain.com" } } }
Than If I have a feature FeatureA will I be able to specify the property that is to be read from external file on the feature level. Is it possible to get the value using FeatureContext in order to run all the scenarios multiple times?0 -
Hi Khaled,
which SpecFlow+ Runner version are you using? Have you tried to activate the Runner as explained in the docs: https://docs.specflow.org/projects/getting-started/en/latest/GettingStarted/Step5.html (maybe you have not selected the "Test" output?Right now the ExternalData plugin only works on scenario level, not on feature level. Here you can find the documentation: https://docs.specflow.org/projects/specflow/en/latest/Guides/externaldata.html
0 -
Hello Mario,
Yes I have selected the test output after installing runner but didn't see any link. As I mentioned before I did the following:
I have specflow version 3.8.14 installed with Specflow.nunit and specflow.Tools.MsBuild.Generation packages as well. All what I did is that I installed SpecRun.Runner and after I rebuild my solution the first time I didn't see any activation link so Does this mean that spec runner is not activated yet? My other question is that every machine where the specflow tests are running I need to activate it? I was really surprised that there is no simple way of running a feature multiple times based on some parameters as other frameworks!
0 -
Hi Khaled,
it's only possible to have 1 unit test provider installed for a SpecFlow project (https://docs.specflow.org/projects/specflow/en/latest/Installation/Unit-Test-Providers.html), that might be a reason why you are not seeing the activation link.
Besides that SpecFlow+ Runner needs to get activated on all machines, besides identified build agents and docker container, where you are not required to activate anything.I quickly coordinated with the team and we realized that Viktor is already trying to help you. It seems that your issue is related to your configuration/setup and not a general issue, therefore I would suggest let's handle the communication via your support request.
0
Please sign in to leave a comment.
Comments
6 comments