用于连接Visual Studio Test Manager的API [英] APIs to connect to Visual Studio Test Manager

查看:94
本文介绍了用于连接Visual Studio Test Manager的API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

请您分享API /如何通过API连接到Visual Studio测试管理器。

Please can you share the APIs/ how to connect to the Visual Studio Test Manager via API.

谢谢,

Moeketsi

推荐答案

您好Moeketsi,

Hi Moeketsi,

班级  ITestManagementService   ITestManagementService 
你想得到什么?

Whether the class ITestManagementService or ITestManagementService is what you want to get?

例如,


下面的代码描述了如何获得测试运行的失败测试用例

TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(newUri(http://%3cserver%3e:8080/tfs/%3Ccollection%3E Jump ));

ITestManagementService testManagement = (ITestManagementService)tfs.GetService(typeof(ITestManagementService));

ITestManagementTeamProject testManagementTeamProject = testManagement.GetTeamProject(teamProject);

ITestRun testRun = testManagementTeamProject.TestRuns.Find(_testRunID);

// Get Failed Test Cases

ITestCaseResultCollection testcases = testRun.QueryResultsByOutcome(TestOutcome.Failed);

foreach (ITestCaseResult testcase in testcases)

{

       // Print Test Case Details

       Console.WriteLine("TestCaseID: " + testcase.TestCaseId);

       Console.WriteLine("TestCaseTitle: " + testcase.TestCaseTitle);

       Console.WriteLine("ErrorMessage: " + testcase.ErrorMessage);

}



参考:

https://social.technet.microsoft.com/wiki/contents/articles/3279.tfs-2010-api-get-results-of-a-test-run.aspx

https://social.technet.microsoft.com/wiki/contents/articles/3279.tfs-2010-api-get-results-of-a-test-run.aspx

https://social.msdn.microsoft.com/Forums/en-US/c56cb833-2183-44e2-84cb-c6d6d3e2c4df/mtm-apis-for-exporting-the-test-cases

https://social.msdn.microsoft.com/Forums/en-US/c56cb833-2183-44e2-84cb-c6d6d3e2c4df/mtm-apis-for-exporting-the-test-cases

如果我误解了这个问题,请随时告诉我。

If I have misunderstood this issue, feel free to let me know.

最好的问候,

杰克


这篇关于用于连接Visual Studio Test Manager的API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆