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 ...
user avatar
  • 30.8k
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 ...
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
user avatar
  • 11.4k
3 votes

Suggestions for "Selling" TDD, and BDD to sceptical non engineering managers

In my experience, you can't sell new development processes. The only path I've found which works is to simply start doing it: Only develop with TDD from this point forward. You'll still deliver your ...
user avatar
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 ...
user avatar
  • 506
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 ...
user avatar
  • 10.8k
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; } ...
user avatar
  • 9,720
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 ...
user avatar
2 votes
Accepted

Specrun - don't stop executing tests after a certain number fail

I was able to fix this by adding stopAfterFailures="-1" to the Execution node in default.srprofile: <Execution retryFor="None" testThreadCount="1" testSchedulingMode="Sequential" stopAfterFailures=...
user avatar
  • 708
2 votes
Accepted

Wrap specflow scenario within try-catch

I found a workaround for this issue where I can check for the exception after each step using the [AfterStep] binding. This works for me, and tests that failed are now marked as inconclusive: [...
user avatar
  • 708
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. ...
user avatar
  • 1,182
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.
user avatar
  • 505
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 ...
user avatar
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 ...
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 ...
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, ...
user avatar
  • 5,834
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?
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 ...
user avatar
  • 4,030
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 ...
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 ...
user avatar
  • 10.8k
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. ...
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 ...
user avatar
  • 30.8k
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 //...
user avatar
  • 9,949
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>...
user avatar
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 ...
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 ...
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 ...
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 ...
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 ...
user avatar
1 vote

What is the best way to have a SpecFlow project run across multiple browsers?

One way we solved this was to have a Given step at the start of each of our features Given I am using <browser> And I am on the Homepage And I click on the Logon Link Then I am taken to the ...
user avatar
  • 111

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