简体   繁体   English

使用 Azure DevOps API 获取测试套件 ID

[英]Get test suite id using Azure DevOps API

I am trying the below API, to get the suite ID using test case ID,我正在尝试以下 API,以使用测试用例 ID 获取套件 ID,

http://tfsb.xxx.com/xxx/xxxSoftware/_api/_testManagement/suites?testCaseId=185295&api-version=5.0

But I always get the below response:但我总是得到以下回应:

404 - File or directory not found. 404 - 未找到文件或目录。

Can any you please tell me how to get the suite ID using testcase ID for Azure DevOps?您能告诉我如何使用 Azure DevOps 的测试用例 ID 获取套件 ID 吗?

这不是正确的 API,根据文档,有一个特殊的 API - Get Suites By Test Case Id

GET https://dev.azure.com/{organization}/_apis/test/suites?testCaseId={testCaseId}&api-version=5.0

Been struggling with this all morning.整个上午都在为此挣扎。 Finally figured out how to get it to work.终于想出了如何让它工作。 You should not put the project / team name in the URL.应该在URL把项目/团队名称。 For example, most API calls look like:例如,大多数 API 调用如下所示:

https://dev.azure.com/{organization}/{project}/_apis/

However, the correct URL for this api call should look like:但是,api 调用的正确 URL 应如下所示:

https://dev.azure.com/{organization}/_apis/

In other words just put the base organization but do not put the project/team.换句话说,只放置基础组织,而不放置项目/团队。

Same if you are using a dedicated organization url, instead of:如果您使用专用的组织 URL,则相同,而不是:

https://mycompany.visualstudio.com/Bigproject/_apis/

you must do你必须做

https://mycompany.visualstudio.com/_apis/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure DevOps 如何通过测试套件 id 添加测试现有测试用例 - Azure DevOps How to add test existing test cases by test suite id REST API 使用测试用例 ID 或测试用例名称更新 Azure Devops 中的测试点执行结果 - REST API to update test point execution outcome in Azure Devops using Test Case ID or Test Case Name 如何在 Azure DevOps API 中获取测试用例的第一个测试运行 ID - How to get the first Test Run ID of the Test Case in Azure DevOps API 使用 Azure devops Rest API 如何通过测试用例 ID 更新测试用例 - Using Azure devops Rest API how to update a test case by test cases ID 使用 Azure Rest API 在测试套件中更新自动化测试用例结果 - Updating Automated Testcase Results in test suite using Azure Rest API 连接到 Azure Devops 中的测试套件和测试人员的测试结果概述 - Overview of Test outcome connected to test suite and tester in Azure Devops 在 Azure DevOps 中获取测试套件的所有手动测试运行 - Getting all manual test runs for a test suite in Azure DevOps 在 azure devops 中克隆同一测试套件中的测试用例 - Cloning a test case within the same test suite, in azure devops 如何使用 azure Devops REST API 从提交 id 中获取分支名称? - How to get branch name from commit id using azure Devops REST API? HTTP GET中的日期格式,用于测试/运行Azure DevOps API查询 - Date format in HTTP GET for test/runs azure DevOps API query
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM