1

I need to put list of items into Scenario.Context. For example i have

IList<IWebElement> test = Driver.FindElements(By.XPath(""));

and it will return more than one values evertime and now if i want it to be stored in Scenario.Context how would i do that ?

Sam Holder
  • 32,535
  • 13
  • 101
  • 181
vic
  • 217
  • 1
  • 7
  • 18

1 Answers1

0

See sample for ScenarioContext scope: https://github.com/techtalk/SpecFlow/wiki/ScenarioContext.Current

For Feature scope it is similar

Store: ScenarioContext.Current.Add(name, test);

Using:

IList < IWebElement > test = (IList < IWebElement >) ScenarioContext.Current[name];

Jan Regent
  • 21
  • 5