FAQ Database Discussion Community


is there a way to use .feature file as input

bdd,specflow
i'm currently trying to learn bdd techniques and trying frameworks for it. the idea comes from test to code, but i want to use it in revers way if possible. i'm currently using specflow, selenium and nunit combination. i want to open my work to anyone (non-developers) for adding new...

BeforeScenarioBlock to execute only before “Given” statement

bdd,specflow
Based on SpecFlow documentation, the [BeforeScenarioBlock] hook will be called before "Given" and "When" statement. Is there any way to make the [BeforeScenarioBlock] hook only to be called before "Given" statement ?

In SpecFlow can you store more than one hook in the same steps file

c#,specflow
In the c# bindings for specflow. Can you store more than one hook in the same file? For example I'm thinking about keep a few hooks together like this [AfterScenario("hook_afterscenario_x_cleanup")] public void AfterScenario() { //do x } [AfterScenario("hook_afterscenario_y_cleanup")] public void AfterScenario() { //do y } If not why?...

Built tests are not added to the Visual Studio Test Explorer window

specflow,white
I set up the SpecFlow plug-in for the Visual Studio 2013. I created new Feature Item and build it. Result: built test is not shown in the Test Explorer. Why? I do it according to this video: https://www.youtube.com/watch?v=LG_0SEeCwh0...

Specflow table selenium

specflow
How to parameterize tables in Specflow? Here is my feature file - Feature: Login As a User, should land on ***** Login page Enter valid Username and password Home page displayed-Validate Logout link Scenario: Successful login Given I am on **** Login page When I enter automation and autopassword Then...

Using Specflow and NUnit version 3 to run tests in paralel

c#,parallel-processing,nunit,specflow
I have a project using SpecFlow and NUnit 2.6.3 as my test provider. Currently it is working OK but now there is the requirement to run tests in parallel, as they become more and more heavy. Reading along, I can see that NUnit version 3 will support parallelism out of...

SpecFlow Ambiguity in bindings

c#,.net,bdd,specflow
I'm working with Spec-flow for quite some days. I am facing "Multiple matching found.Navigating to first match", while Debugging this can be solved, but when I'm running the entire solution Its failing because of Ambiguity in bindings. I'm running around 4 C sharp class files in a Single project Feature:...

Where is the Visual Studio 'Test Explorer' Output located? Is it a saved file?

c#,visual-studio,specflow,test-explorer
I'm using SpecFlow for unit testing in Visual Studio 2013, and when I run tests from the Test Explorer window, there is a link to an Output which shows anything written to the console during the test. When right-clicking the tab, I don't have the option to Open Containing Folder...

How to make step argument dependent on configuration?

c#,specflow,gherkin
Problem I am using SpecFlow to create an integration test suite for a REST service. I am running the suite in multiple different configurations. (I have multiple Build configurations, each with its own set of app.config transformations.) In the C# code, it's very simple to check the configuration and execute...

Multiple Scope value in Binding (Specflow)

scope,automated-tests,specflow,feature-selection,feature-file
I have a method which runs Before a feature like so, [BeforeFeature, Scope(Feature = "Feature1"] Method() { } I want the same method to be ran for another feature file that i've wiritten i.e. Feature2 How do i combine this "Feature2" in the scope Binding? I tried this [BeforeFeature, Scope(Feature...

Specflow,Selenium-Share data between different Step definitions or classes

selenium-webdriver,specflow
I just started using Spec flow along with Selenium & N Unit . I have a basic question, maybe I know the answer to it, but want to get it confirmed. Consider, there are 2 features - Register, Add new transaction . 2 separate features with their respective Step definitions....

Is it possible to run multiple Examples in a Scenario Outline without closing the browser?

c#,specflow
So we are using SpecFlow (C# with Selenium WebDriver) in order to do functional testing. I am still pretty new to using SpecFlow and Selenium. My mentor has told me that they want scenarios written in a way that only has one when and then (you set up your test,...

What governs when [BeforeScenario] is run in SpecFlow?

c#,specflow
I've recently started on an existing project that uses SpecFlow. I've added a method with [BeforeScenario] in BaseSteps.cs that does some logging. BaseSteps.cs doesn't have a [Binding] attribute on its class, but the derived classes do have [Binding]. However, an example.feature can use steps from differentDerivedSteps.cs classes. In these case...

How to integrate Appium with C#?

c#,selenium-webdriver,appium,specflow
I am unable to find a single post where i can automate mobile testing with appium in C#. I have written my Website automation code in the specflow. Can I also Reuse it ?...

Injecting data into running IISExpress from SpecFlow

asp.net-mvc,bdd,iis-express,specflow
I'm new to the ASP.NET MVC 5 world and SpecFlow. I'm trying to put together a simple example for learning purposes. I've a ASP.NET MVC project in one assembly and a SpecFlow definition in another. I'm trying to avoid having a database in the setup since I'm trying to keep...

Providing Examples in more than 1 row Specflow

c#,.net,bdd,specflow
When I provide examples in a single row it works fine. When I provide examples in more than a row I'm getting binding parameter exception. If I provide all examples in a single line its not readable easily. Feature: ConversionUnencrypted Pdf-Pdf @mytag Scenario Outline: ConversionUnencrypted Pdf-Pdf Given I get Inputs...

Regenerate steps for scenarios in specflow

specflow,auto-generate,scenarios
Is there a way i can "regenerate" steps for the scenarios in specflow. Currently my feature file has steps which are already bound to it. I would like to generate steps again and write the code all over again without deleting my previous step files. In case you are wondering...