Roo
Roo

Reputation: 427

specflow - get the scenario duration

How do I read the scenario running time programmatically?

I can see it in visual studio however I am not able to read this value.

(I have currently implemented a stopWatch to get the timer, however, it would make my code cleaner if I just used something from Specflow.)

enter image description here

Upvotes: 2

Views: 748

Answers (1)

Andreas Willich
Andreas Willich

Reputation: 5825

There is an internal Stopwatch on the ScenarioContext: https://github.com/techtalk/SpecFlow/blob/master/TechTalk.SpecFlow/ScenarioContext.cs#L57

If you provide a PR that makes the Elapsed property of it accessible for the outside, I am happy to merge it in.

Upvotes: 1

Related Questions