如何捕获当前在C#测试方法中在MTM中运行的测试用例ID

时间:2013-02-08 17:34:20

标签: microsoft-test-manager visual-studio-test-runner

如何使用C#代码实际捕获当前在MTM中运行的当前测试用例ID?

谢谢&的问候,

伍德森

1 个答案:

答案 0 :(得分:1)

有同样的问题并找到答案:how-to-retrieve-the-id-of-the-workitem-that-started-an-automated-test

基本上,您可以使用TestContext

string tcId = TestContext.Properties["__Tfs_TestCaseId__"].ToString();获取
相关问题