Sometimes you want to use data in other steps. Maybe you have generated some value types or reference types which you have to use. This is not so difficult, but keep in mind, that the Context will be emptied for the next Scenario. You can pass data just between steps in the same Scenario.

Below, you see a simple example where we add a key value pair of firstNumber and po, secondNumber and p1. You can also pass in reference types. In the When step, I am reading it out of the context and adding it to a new key value pair which I am again using in the Then step.

Have fun..

Passing data between steps in Specflow
Tagged on:     

Leave a Reply


Get every new post on this blog delivered to your Inbox.

Join other followers:

Welcome Damir Kusar

Log in

Lost your password?
%d bloggers like this: