Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8441985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:43:20+00:00 2026-06-10T08:43:20+00:00

I am looking for a way to implement inheritance in specflow features. For e.g

  • 0

I am looking for a way to implement inheritance in specflow features. For e.g a base features class which has common scenarios which have to be tested.

3-4 derived features classes which inhert all the scenarios in the base class and add some of their own. Similarly the Binding class will also follow a inheritance structure. This is needed to test an ASP.NET MVC application which has a base controller (scenarios in base features class) and 4-5 implementations.

I can copy the features file for each derived controller class but this would lead to considerable duplication.

Is this possible in specflow, Or am I going down the wrong route? Please help. thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:43:22+00:00Added an answer on June 10, 2026 at 8:43 am

    I’m not 100% sure if this is the right path to take (read as, I’ve never needed to do anything like this). For me any inheritance and re-use comes in the Step Definitions (or Binding) classes. But even so…

    I don’t know if you can simply do this using the tools available in SpecFlow – but you have the following option so far as I can see (this isn’t a tested theory… I might test it later – but I figured this might offer you an idea…)

    • The “code-behind” (designer-generate-code) for your Feature files are partial class implementations…
    • …so I guess you could create a “base” (generic) Feature file…
    • …then create a partial class file for each of your specific/implementation Feature files’ code-behinds…
    • …each partial class will specify a base class which is the generated class name from the “base” Feature file code-behind.

    Hopefully this helps a little.

    EDIT:
    Okay I’ve tested this theory… It would work as I’ve described above. I just created a new project with associated test/spec project, and did the above in the test/spec project. The test runner ran the base feature, and then ran the specific/implementation feature… which included the base feature again.

    Have a go – it takes less than 5 minutes to knock up what I’ve suggested, and see if the result fits your requirement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assuming I have a class derived from Shape. I'm looking for way how to
I'm looking for the best way to implement the following. I have a MySQL
In my current code I have an TNCPConnection class which is derived from enable_shared_from_this
I'm looking for a way to implement drag and drop with multi touch in
Looking for some advice on the best way to implement localization along with client
I'm looking for a good way to implement a truly modal dialog in Silverlight
I'm looking for ideas on how to implement a way to get web based
I'm looking for a way to implement a surface (in C#, Windows Forms) where
We're looking for a way to implement subtables in JSF 1.1. We cannot use
Looking to see if there is any way to implement the kind of functionality

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.