簡體   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