1

アイテムのリストを Scenario.Context に入れる必要があります。たとえば、私は持っています

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

そして、それは常に複数の値を返します.Scenario.Contextに保存したい場合はどうすればよいですか?

4

1 に答える 1

0

ScenarioContext スコープのサンプルを参照してください: https://github.com/techtalk/SpecFlow/wiki/ScenarioContext.Current

機能範囲の場合も同様です

ストア: ScenarioContext.Current.Add(name, test);

使用:

IList < IWebElement > テスト = (IList < IWebElement >) ScenarioContext.Current[name];

于 2015-10-17T13:43:55.517 に答える