【问题标题】:Get test suite id using Azure DevOps API使用 Azure DevOps API 获取测试套件 ID
【发布时间】:2021-02-26 03:19:33
【问题描述】:

我正在尝试以下 API,使用测试用例 ID 获取套件 ID,

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

但我总是得到以下回复:

404 - 找不到文件或目录。

您能告诉我如何使用 Azure DevOps 的测试用例 ID 获取套件 ID?

【问题讨论】:

  • 您好朋友,请检查Shayki 的回答是否有助于解决您的问题。如果问题仍然存在并阻止您,请随时告诉我们,请参阅 this,只是一个提醒 :)

标签: azure-devops azure-devops-rest-api


【解决方案1】:

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

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

【讨论】:

  • 你能指导一下如何在这个API中添加授权吗?
【解决方案2】:

整个上午都在为此苦苦挣扎。终于知道如何让它工作了。您应该将项目/团队名称放在 URL 中。例如,大多数 API 调用如下所示:

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

但是,this api 调用的正确 URL 应如下所示:

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

换句话说,只放置基础组织,而放置项目/团队。

如果您使用的是专用组织 URL,则相同,而不是:

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

你必须这样做

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-01-03
    • 1970-01-01
    • 1970-01-01
    • 2022-07-07
    • 1970-01-01
    • 2021-06-09
    • 2021-08-28
    • 1970-01-01
    相关资源
    最近更新 更多