【问题标题】:How to add test cases to microsoft test manager through program如何通过程序将测试用例添加到微软测试管理器
【发布时间】:2016-05-17 19:43:04
【问题描述】:

我在一个 Excel 文件中有一组测试用例。我需要通过 c# 程序/或某些脚本语言将它导入到 Microsoft 测试管理器。我搜索了网页,但大多数答案都指向使用“测试用例迁移器 plus”。他们还使用测试用例迁移器将测试用例从 excel 导入到 TFS(团队基础服务器)而不是 MTM。但我需要通过我的程序来完成。我可以使用 c# 程序使用测试用例迁移器吗?或者有什么方法可以将测试用例添加到 MTM 中?感谢您的帮助。 另外,我查看了类似于 upload test cases from excel to microsoft test manager 2013 的帖子,但对我来说,它们未能解决我的问题。

【问题讨论】:

    标签: c# visual-studio tfs testcase microsoft-test-manager


    【解决方案1】:

    您可以使用 TFS API 创建测试用例。这是来自blog post 的一些示例代码,它充分解释了该过程。

         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(); 
    

    【讨论】:

    • 这对我帮助很大!.. 谢谢,博客解释了大部分必需的东西。再次感谢你。
    猜你喜欢
    • 2018-11-11
    • 2019-06-28
    • 2020-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多