johndoe
johndoe

Reputation: 21

SpecFlow ScenarioContext.Current is always returning null

I am trying to insert a value in ScenarioContext.Current but for some reason ScenarioContext.Current is null.

Upvotes: 2

Views: 2930

Answers (2)

user710483
user710483

Reputation: 71

If you're in a [BeforeFeature], have you tried using FeatureContext.Current instead?

Upvotes: 7

dbruning
dbruning

Reputation: 5122

I've discovered that ScenarioContext.Current is null inside [BeforeFeature], which was not what I initially expected. Where are you calling ScenarioContext.Current from?

Upvotes: 1

Related Questions