I try to get all results of a TestCase via API. In the UI I see a list of all results of a TC via the following url:
https://dev.azure.com/xxx/yyyy/_testPlans/_results?testCaseId=48587
How can I do this via API?
How can I do this via API?
I am afraid that you couldn't find this API in Official document.
But you could get the API in Browser console:
Here are the API and Request Body:
API URL:
POST https://dev.azure.com/{OrganizationName}/_apis/Contribution/HierarchyQuery?excludeUrls=true&enumsAsNumbers=true&msDateFormat=true&noArrayWrap=true&api-version=5.0-preview.1
Request Body:
{
"contributionIds":["ms.vss-test-web.testcase-results-data-provider"],
"dataProviderContext":
{"properties":
{
"testCaseId":testcaseid,
"sourcePage":{"url":"https://dev.azure.com/{OrganizationName}/{ProjectName}/_testPlans/execute?planId={TestPlanId}&suiteId={Test SuiteID}","routeId":"ms.vss-test-web.testplans-hub-refresh-route","routeValues":{"project":"{ProjectName}","pivots":"execute","controller":"ContributedPage","action":"Execute"}}
}
}
}
Result:
If you want to get detailed info, you could pass the Test Run id and test result ID to Rest API: Results - Get