0

I'm trying to get all the test cases from a test suite in VSTS, even test cases that have no run data, marked as "Active." I know how to get the case ID, but not the name/title. Right now it goes through the run data and results and gets all the information from the result, but it won't work if there is no run data.

I'm working in C# using RestSharp for RestRequests. This is one of my RestRequests: /_apis/test/runs?planId=" + planID.ToString() + "&includeRunDetails=true&api-version=5.0-preview.2 This works to get all the information I need for test cases with run data. I have been using Microsoft docs on VSTS API for help: https://learn.microsoft.com/en-us/rest/api/vsts/?view=vsts-rest-5.0

Getting the test cases from the suite would be ideal, but I'll accept anything that works.

3
  • More information is needed... are doing this in F#? Do you have a sample of code of what you have tried so far? Commented Jul 17, 2018 at 17:59
  • I'm working in C# using RestSharp for RestRequests. This is one of my RestRequests: /_apis/test/runs?planId=" + planID.ToString() + "&includeRunDetails=true&api-version=5.0-preview.2 This works to get all the information I need for test cases with run data. I have been using Microsoft docs on VSTS API for help: learn.microsoft.com/en-us/rest/api/vsts/?view=vsts-rest-5.0 Commented Jul 17, 2018 at 18:02
  • Could you edit your question and everything in it? It will be easier for people to provide you with an answer... Commented Jul 17, 2018 at 18:07

1 Answer 1

1

You can combine Get all test cases in a suite api and Returns a list of work items api. First, get the test case ids from the api below:

GET https://{accountName}.visualstudio.com/{project}/_apis/test/Plans/{planId}/suites/{suiteId}/testcases?api-version=5.0-preview.3 

Then, get more information of the test cases from the following api:

GET https://{accountName}.visualstudio.com/{project}/_apis/wit/workitems?ids={ids}&api-version=5.0-preview.3 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.