繁体   English   中英

如何通过程序将测试用例添加到Microsoft测试管理器

[英]How to add test cases to microsoft test manager through program

我在excel文件中有一组测试用例。 我需要通过ac#程序/或某些脚本语言将其导入到Microsoft测试管理器。 我搜索了网络,但大多数答案都指向使用“测试用例迁移器加”。 他们还使用测试用例迁移器将测试用例从excel导入到TFS(team Foundation Server),而不是MTM。 但是我需要通过我的程序来完成。 我可以通过ac#程序使用测试用例迁移器吗? 还是有什么方法可以将测试用例添加到MTM? 感谢您的帮助。 另外,我检查了类似于将测试用例从excel上传到Microsoft Test Manager 2013的帖子,但对我来说,它们未能解决我的问题。

您可以使用TFS API创建测试用例。 这是博客文章中的一些示例代码,该代码完整说明了该过程。

     ITestCase testCaseCore = testManagementTeamProject.TestCases.Create(); 
     currentTestCase = new TestCase(testCaseCore, sourceTestCase.ITestSuiteBase, testPlan); 

     currentTestCase.ITestCase.Area = sourceTestCase.Area; 
     currentTestCase.ITestCase.Title = sourceTestCase.Title; 
     currentTestCase.ITestCase.Priority = (int)sourceTestCase.Priority; 
     currentTestCase.ITestCase.Actions.Clear(); 
     currentTestCase.ITestCase.Owner = testManagementTeamProject.TfsIdentityStore.FindByTeamFoundationId(sourceTestCase.TeamFoundationId); 

     currentTestCase.ITestCase.Flush(); 
     currentTestCase.ITestCase.Save(); 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM