自动获取测试计划中所有测试用例的测试结果 [英] Automatically get test results of all the test cases in a test plan
问题描述
嗨专家,
我有一个包含200个测试用例的产品版本X的测试计划。
I have a test plan for version X of a product with 200 test cases.
明年将发布新的Y版本,因此我克隆或复制了上述测试计划并添加了50个新的测试用例,所以现在我有250个。
Next year, anew version Y is to be released, so I cloned or duplicated the above test plan and added 50 new test cases, so now I have 250.
在上一年之后,另一个版本Z,再次使用克隆或重复的测试计划,超过250加20多个,总共270个。
After the above year,another version Z , again with a cloned or duplicated test plan with above 250 plus 20 more, a total of 270.
现在Z有200个版本的XI不想运行所有200个,但是想要检查这些200中有多少通过X和Y以便我可以在Z中避免它们,以节省时间。
Now Z has 200 cases from version X.I do not want to run all 200, but want to check how many out of these 200 passed in X and Y so that i can avoid them in Z, to save time.
对于测试计划的所有三个版本,X,Y和Z,是否有办法获得测试计划中每个测试用例的测试结果。
Is there a way to get test results for every test case in the test plan fro all three version for test plans , X, Y and Z but separately.
感谢您的帮助。
问候,
Aditya
Aditya
推荐答案
嗨Aditya,
Hi Aditya,
您可以检索详细信息使用TFS API测试结果。
You can retrieve the detail test results by using TFS API.
有一个类似的线程:
使用TFS API显示测试结果表单测试套件
var tfsCollection = new TfsTeamProjectCollection(
new Uri(tfsUrl),
new System.Net.NetworkCredential(<user>, <password>));
tfsCollection.EnsureAuthenticated();
var testManagementService = tfsCollection.GetService<ITestManagementService>();
var teamProject = testManagementService.GetTeamProject(projectName);
var testPlan = teamProject.TestPlans.Find(testPlanId);
// Get all Test Cases belonging to a particular Test Suite.
// (If you are using several Test Configurations and want to take only one of them into account,
// you will have to add 'AND ConfigurationId = <your Test Configuration Id>' to the WHERE clause.)
string queryForTestPointsForSpecificTestSuite = string.Format("SELECT * FROM TestPoint WHERE SuiteId = {0}", suiteId );
var testPoints = testPlan.QueryTestPoints(queryForTestPointsForSpecificTestSuite);
// We are going to use these ids when analyzing Test Results
List<int> testPointsIds = (from testPoint in testPoints select testPoint.Id).ToList();
var testResults = teamProject.TestResults.ByTestId(testCaseId);
var testResultsForSpecificTestSuite = testResults.Where(testResult => testPointsIds.Contains(testResult.TestPointId));
问候
Starain
这篇关于自动获取测试计划中所有测试用例的测试结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!