获取给定 ALM REST API 中的测试集文件夹路径的所有测试集 [英] Get all Test Sets given a Test Set Folder path in ALM REST API

查看:62
本文介绍了获取给定 ALM REST API 中的测试集文件夹路径的所有测试集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 PHP 获取给定文件夹中所有测试集中的所有测试用例.

I'm using PHP to get all the testcases in all testsets in a given folder.

我按照这个教程建立连接,我正在使用以下查询 以获取我想要作为我的 root 的测试集文件夹的 id:

I followed this tutorial to make the connection and I'm using the following query to get the id of the test-set-folder I want as my root:

例如,这给我一个 id=12345.

如何获取此测试集文件夹下的所有测试用例?

How can I get all the testcases below this testset folder?

推荐答案

所以经过一番调查,我终于解决了我的问题,所以我会分享我所学到的.

So after some investigation I finally managed to solve my question so I will share what I learned.

登录 QC REST:http://IP:PORT/qcbin/rest/is-authenticated?login-form-必需=y

获取特定文件夹的数据:http://IP:PORT/qcbin/rest/domains/MYDOMAIN/projects/MYPROJECT/test-set-folders?query={name['MYFOLDER']}

GET DATA FOR SPECIFIC FOLDER: http://IP:PORT/qcbin/rest/domains/MYDOMAIN/projects/MYPROJECT/test-set-folders?query={name['MYFOLDER']}

从之前的调用中我们得到了很多值.我们将使用 hierarchical-path 并在下一个请求中使用它.注意 *.这是为了让所有的测试集低于选择的层次路径.

From the previous call we get many values. We will use the hierarchical-path and use it in the next request. Note the *. This is to get all the test sets bellow the hierarchical-path selected.

在上一步中获取文件夹下的所有测试集:http://IP:PORT/qcbin/rest/domains/MYDOMAIN/projects/MYPROJECT/test-sets?query={test-set-folder.hierarchical-path[hierarchical-path*]}

GET ALL TESTSETS BELOW THE FOLDER IN THE PREVIOUS STEP: http://IP:PORT/qcbin/rest/domains/MYDOMAIN/projects/MYPROJECT/test-sets?query={test-set-folder.hierarchical-path[hierarchical-path*]}

这里我们得到每个测试集的结果.我们可以获得每个测试集的idname以及其他数据.我们将在下一个查询中使用 id 来获取测试用例

Here we get results for each testset. We can get the id and name of each testset among other data. We will use the id on the next query to get the Test Cases

获取每个测试集 (ID) 的所有测试用例:http://IP:PORT/qcbin/rest/domains/MYDOMAIN/projects/MYPROJECT/test-instances?query={cycle-id[ID]}

GET ALL TESTCASES FOR EACH TESTSET (ID): http://IP:PORT/qcbin/rest/domains/MYDOMAIN/projects/MYPROJECT/test-instances?query={cycle-id[ID]}

最后,我们可以使用上一步返回的 test-id 从特定测试用例中获取更多数据.

Finally, we can get more data from specific test cases, using the test-id returned from the last step.

获取测试用例详细信息:http://IP:PORT/qcbin/rest/domains/MYDOMAIN/projects/MYPROJECT/测试/TEST_ID

这篇关于获取给定 ALM REST API 中的测试集文件夹路径的所有测试集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆