0

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.

Community
  • 1
  • 1
JohnZaj
  • 3,080
  • 5
  • 37
  • 51

1 Answers1

0

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();
JohnZaj
  • 3,080
  • 5
  • 37
  • 51