Site Loader
Auckland, New Zealand
In this post we will discuss about scoped bindings of specflow, in short, the scoped binding feature will let our step definitions to be duplicated and run on scope of either
  • Feature
  • Scenario
  • Tag
Before talking more about scoped bindings, lets first understand about bindings even more clearer


Bindings in Specflow are global as we know, hence, each and every step in feature files of a scenario are tide with a specific step definitions. If there are cases, where we need to change the scope of the step to be executed in certain condition using existing bindings, then we will end up with ambiguity problem. In order to resolve the problem, Specflow have something called as Scoped Bindings

Scoped Bindings

Using the Scope attribute for any step definition, we can restrict certain hooks like
  • Features
  • Scenarios
  • Tags
These hooks can be executed based on the scope which is defined within them. Please find below the complete video of the above discussion along with an analogy

Thanks for reading the post and watching the video !!!

Please leave your comments and let me know if there is anything I should update in this post.

Thanks, Karthik KK

Post Author: Karthik kk

Leave a Reply

Your email address will not be published. Required fields are marked *