How to get value from Example in Beforescenario

22 views
Skip to first unread message

mohit sharma

unread,
Oct 30, 2020, 7:32:23 AM10/30/20
to SpecFlow
Hi team,

I am using specflow runner+, 

Is there a way I can get Examples value at runtime?

e.g. For each scenario and I want to get value from an example in beforescenario so that I can decide logic based Countrycode 

Following is sample of scenario I am using

Feature: testfeature
@Platform_Chrome
Scenario: abc
Given:...
When.....
Then....
Examples:
| Countrycode|
| US       |
| CA       |
| AU       |
| NZ       |

Andreas Willich

unread,
Oct 30, 2020, 7:56:16 AM10/30/20
to SpecFlow
The ScenarioInfo on the ScenarioContext has an Arguments property, where you can access the parameters of the current example.

-------



--
You received this message because you are subscribed to the Google Groups "SpecFlow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to specflow+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/specflow/4da059d8-9387-49eb-ac2a-4ad0bfbd9865n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages