4 votes

Is it good practice to skip the When clause in Gherkin/Cucumber/SpecFlow?

It depends The point of the Given/When/Then pattern is that it describes test preconditions (Given), actions (When), and expected results (Then) - very similar to the unit test arrange/act/assert ...
Kate Paulk's user avatar
  • 31.5k
4 votes
Accepted

Can a scenario have multiple example tables?

I believe there is no support for multi-dimensional examples tables in Gherkin scenarios as you have described. Also keep in mind what BDD is largely for: being readable to the business. We developers ...
Jacob Hackel's user avatar
3 votes

Can we use java to design specflows?

Use cucumber. Specflow is a part of cucumber family that is developed for .Net world. So if you do not need .Net but need Java, just use the solution that was originally intended for Java
Alexey R.'s user avatar
  • 11.6k
3 votes
Accepted

Which runner to use with Specflow Cucumber BDD: Specflow Runner, Nunit, Xunit

Configuring the Unit Test Provider Tests are executed using a unit test provider. Add the corresponding NuGet package to your project to define your unit test provider: SpecRun.Runner SpecFlow.xUnit ...
PDHide's user avatar
  • 11k
3 votes

Which is the better way for data-driven testing for Specflow automated tests?

Hope it is not too late to reply. For data-driven-testing, I prefer SpecFlow's Scenario Outline approach than csv file for a automated test. Why? As a known benefit of BDD, SpecFlow's Scenario ...
Chaochana's user avatar
  • 506
2 votes

Specflow Page Object Model Maintainability

My very personal opinions, please take them as a grain of salt In public class LoginStepDefinitions public LoginStepDefinitions(IWebDriver _driver) { driver = _driver; } ...
Yu Zhang's user avatar
  • 9,922
2 votes
Accepted

Unable to click on checkbox using Selenium WebDriver

Rather than accessing the element by Id try doing it with xpath. I can see the there is an tag attached to this element. So you could make use of that.So for example if your checkbox is setup like ...
user1519137's user avatar
2 votes

Use Gherkin syntax for Acceptance Criteria without accompanying BDD tool

Cucumber won't magically make tests from your Gherkin features. With all those tools you still have to write the step definitions and the code that actually makes the tests happen and maintain it. ...
Amias's user avatar
  • 1,202
2 votes

Is it good practice to skip the When clause in Gherkin/Cucumber/SpecFlow?

No, the when is the action you are testing. Why not write it as: Scenario: User has to open a website Given Joey (a typical user) that has access to the website When Joey visits the page Then ...
Niels van Reijmersdal's user avatar
2 votes

How to repeatedly run tests which add the same user to the system

Ideally, your tests should always run against the same configuration so they are 100% reproducible. This also includes the database. There are two typical options to solve your issue: As mentioned, ...
FDM's user avatar
  • 5,904
2 votes

No Option To "Generate Step Definitions" In Specflow

Right Click In The Code Editor (And Not The Solution Explorer) And The Option To "Generate Step Definitions" Is There.
OA345's user avatar
  • 545
2 votes

Specflow plus evaluation version attaching a screenshot

We have an example https://github.com/techtalk/SpecFlow.Plus.Examples/tree/master/SeleniumWebTest which adds screenshots to the report. Have a look at it. Full disclosure: I am one of the maintainers ...
Andreas Willich's user avatar
2 votes
Accepted

How can I turn a list of assertions into a table? C#/Specflow Selenium

Your specflow file should look like this: Then the Details page should display the rating zip code And the Details page should display | Parameter | Value | | ID | 5 ...
Michal Dobrzycki's user avatar
1 vote

Which runner to use with Specflow Cucumber BDD: Specflow Runner, Nunit, Xunit

xUnit. ( ... or even unittest, pytest, if you would consider python: "unittest : A unit testing framework for Python. It is python’s xUnit style framework." )
Solid T.'s user avatar
1 vote

Browser is closed only if test passed on VM

For me as it turned out it was a chrome driver version issue, after updating the chrome driver the issue was resolved.
Sathira Padukka's user avatar
1 vote

Specflow Cucumber BDD - Only log in once on test run not on every scenario

I would go with different features. CAN you go with DB1.feature doing everything and then DB7.feature? Can you create employee and customer in one run on the same DB?
Michal Dobrzycki's user avatar
1 vote
Accepted

Specflow Cucumber BDD - Only log in once on test run not on every scenario

I don't recommend reusing sessions but you could do the login as part of your [OneTimeSetUp]/[AssemblyInitialize] in your test class and likewise [TearDown]/[AssemblyCleanup] the session (what you use ...
kirbycope's user avatar
  • 4,070
1 vote
Accepted

Benefits of BDD tools such as SpecFlow for tech debt in automation

In your case I don't think BDD (or its cousin TDD) is necessarily the right tool for what you are doing. Rather than developing application code based on desired behavior as captured in tests, it ...
Michael Durrant's user avatar
1 vote
Accepted

Use Gherkin syntax for Acceptance Criteria without accompanying BDD tool

Benefits of gherkin non-automated: Has rigid structure (given/when/then, steps and tables) Can be more familiar to QA and DEV Easy to put to source control and review changes as textual diffs Can be ...
Mykola Gurov's user avatar
1 vote
Accepted

API Testing with Specflow BDD Selenium?

It all depends on the logic you intend on testing, and when the test fails, how large an area of the application you'll need to investigate. A full end-to-end test verifies data on screen. Doing this ...
Greg Burghardt's user avatar
1 vote

API Testing with Specflow BDD Selenium?

In this case , The only need for testing the backend database is when you doubt whether the browser is actually getting the data from the database or is it simple caching it in cache or browser local ...
PDHide's user avatar
  • 11k
1 vote
Accepted

In Visual Studio 2019, The Name Of The Scenario In Test Explorer Is Different From The Test That I Want To Run

Feels like the generation of the code behind is not working correctly. Specflow creates .cs file for each .feature file. This .cs file contains the "real" testcode that is found by the test-explorer. ...
Niels van Reijmersdal's user avatar
1 vote

Setup of Test automation framework from scratch using NUnit and Specflow and RestSharp and selenium with Visual Studio 2017 C#

I agree that you don't need Selenium. Instead of a Page Object Pattern, you want to model your request and response objects as classes. RestSharp has dependencies on JSON serializer and deserializer ...
Kate Paulk's user avatar
  • 31.5k
1 vote

Setup of Test automation framework from scratch using NUnit and Specflow and RestSharp and selenium with Visual Studio 2017 C#

You seem good to go with some service testing. NUnit -> I want to use parallel test methods execution/calling with Priorities using C# similar to TestNG in Java. //Arrange //Act //...
João Farias's user avatar
  • 10.5k
1 vote

Specflow scenario outline with then table

Add your assertions to the examples table, and reference them in the Then step: Feature: MyFuture @Do something Scenario Outline: Verify bla bla Given run I ... with <jj>,<kk>...
Greg Burghardt's user avatar
1 vote
Accepted

How can I parameterize multiple users login in your specflow gherkin (Selenium Webdriver)?

You will have to change the environment based on the parameter from the Gherkin file. For example: Given The actor logs in the "environment" environment with "username" and "password". I do not ...
Koen Meijer's user avatar
1 vote

How can I parameterize multiple users login in your specflow gherkin (Selenium Webdriver)?

Every Example in a Gherkin file will execute as a test. So when you want to use every user credential you would also have to switch the environment via the Gherkin file. In this way every test will ...
Koen Meijer's user avatar
1 vote

How can I organize my Specflow test cases?

I would consider breaking it up into Patient Info and Physician Verification. You mention tabs - can these windows be accessed separately? I would try and treat them separately in separate specs if ...
Michael Durrant's user avatar
1 vote
Accepted

Is there a software that tells the number of possible flows when "inputing" an workflow?

Although the technical answer to your question is no, there are some methods which help you limit the number of scenarios you need to cover to provide suitable coverage. I particularly like the ...
ECiurleo's user avatar
  • 2,043
1 vote

Specflow and selenium, best practice for passing page objects between steps?

I use Spinach and write tests in Ruby but I face the same issues when writing my tests - looks like managing page object context across the steps is a common problem when using Cucumber-like BDD ...
Artem Levik's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible