Visual Studio Team Services

Retrieve TestPoints in & under a particular TestPlan or TestSuite recursively

Recently I wanted to optimize data retrieval and minimize query counts in one of my Tfs applications regarding retrieval of TestPoints for a particular TestPlan or TestSuite  including all its Sub-/Childsuites.

This can be achieved by utilizing the ’RecursiveSuiteID’ field in your queries, e.g. like this:

ITestPointCollection testPointCollection = testPlan.QueryTestPoints(string.Format(“SELECT * FROM TestPoint WHERE RecursiveSuiteID = {0}”,parentSuiteID));

However, if you want to retrieve TestPoints for a give, particular set of suites and sub-suites, there’s no other way to either combine your .QueryTestPoints(..) query with a comma-separated list of TestSuite Ids (TestPlans are suites, too), for example like this: “[…] WHERE SuitId IN 1,2,3 […]” or alternatively iterate recursively over the TestPlan.TestSuites properties & data structures.


Comments disabled.