0

I use data driven test and coded ui test. I want to capture current Test Case ID that's current being run in the MTM. How can I do? For example;

[Datasource("Microsoft.VisualStudio.TestTools.DataSource.TestCase", "http://alm...", "?????",  DataAccessMethod.Sequential), TestMethod]

public void login1()
{
this.UIMAP.Login(TestContext.DataRow["url"].ToString());
}

Thanks,

chaliasos
  • 9,659
  • 7
  • 50
  • 87
Erdem Azaklı
  • 255
  • 1
  • 8
  • 27

1 Answers1

2

You can't.

All attributes need constant values and you cannot pass something that its value will not be known at compile time.

So, you have to pre-define the value of the test case id when you code your test.

chaliasos
  • 9,659
  • 7
  • 50
  • 87