0

This question is related to VSTS. I can get test run results (Outcomes) using test run Id in REST API. I need test run results by using test case Id in REST API. Is there any API link is available for this, if so please provide me API link or can we get it through wiql query?

Community
  • 1
  • 1
  • Have you read the documentation? It's very useful – L_Church May 17 '18 at 10:58
  • I read that documentation and I found that we can get test case Id if we use test run Id in REST API. But I want test run Id (better if I can get test outcome) if I pass test case Id in REST API. – Hansmukh Jain May 17 '18 at 11:23

1 Answers1

0

No such REST API can get test result through test case id directly, but you can do it with client API:

TfsTeamProjectCollection teamCollection;
            ITestManagementService service;
            ITestManagementTeamProject project;
            var picker = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false);
            picker.ShowDialog();
            if (picker.SelectedTeamProjectCollection != null && picker.SelectedProjects != null)
            {
                teamCollection = picker.SelectedTeamProjectCollection;
                service = teamCollection.GetService<ITestManagementService>();
                project = service.GetTeamProject(picker.SelectedProjects.First().Name);
            }
            else
            {
                return;
            }

            var result = project.TestResults.ByTestId({test case id}).Last();
starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53