Pergunta

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.

Foi útil?

Solução

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();
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top