문제

How can I get the data from a row in the current running test? this answers how to get the iteration number ie 0,1,2.. of the running test:

int currentIteration = TestContext.DataRow.Table.Rows.IndexOf(TestContext.DataRow);

However, I would like to get the actual data in this row.

도움이 되었습니까?

해결책

Simpler than I expected. this is for a single column table, so the ItemArray will always be 0:

string currentIterationData = TestContext.DataRow.ItemArray[0].ToString();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top