June 20th, 2014, 02:39 AM
TFS API - Search For Test Case by custom field “Extended ID”, in a specific hierarchy
I'm new to TFS API. I have looked around but found incomplete solutions to my problems.
What I want to do is search for a specific test case by its custom field "Extended ID" = "EXT:123" in Test Plan with Id = 104, and Test Suite with Id = 1455. Maybe there are 2 parts to this question.
1) Is TestSuiteID unique throughout the entire test plans within a project? If not, then I would have to search for a specific test suite by digging down the hierarchy "Project"-->"TestPlan"-->"TestSuite". How do I do that?
2) Could anyone kindly show me how I could search for a specific test case by its custom field "Extended ID" = "EXT:123" within a specific test suite?
So far, I have
Thanks in advance!!
string tfsUrl = "http://tfs:8080/tfs/DefaultCollection";
string projectName = "MyProduct";
int testPlanId = 111;
int testsuiteId = 2222;
int extendedId = "EXT:123";
ITestManagementTeamProject proj = GetProject(tfsUrl, projectName);
var tps = proj.TestPlans;
var tp = tps.Find(testPlanId);
// How do I find a Test Suite within a Test Plan?
// Searching for a Test Suite ID within a project works only if its unique throughout all test plans within the project
var tss = proj.TestSuites;
var ts = tss.Find(testsuiteId); // This works
var tcs = ts.AllTestCases;
foreach (var tc in tcs)
// I want to find a test case with custom field "Extended ID" that matches "EXT:123"
if (tc.??????? == extendedId)
var testResults = proj.TestResults.ByTestId(tc.Id);
// How do I update its test result?
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.