0 环境描述
本文档中,所使用的测试环境地址为http://alm.moelab.cn/polarion/
0.1 接口调用逻辑顺序

1 登陆接口
登陆Polarion系统,获取SessionID
1.1 请求地址
http://alm.moelab.cn/polarion/ws/services/SessionWebService
1.2 请求方式
POST
1.3 请求头
SOAPAction : http://alm.moelab.cn/polarion/ws/services/SessionWebService
1.4 请求报文
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ses="http://ws.polarion.com/SessionWebService-impl"> <soapenv:Header/> <soapenv:Body> <ses:logIn> <ses:userName>admin</ses:userName> <ses:password>admin</ses:password> </ses:logIn> </soapenv:Body></soapenv:Envelope>
| 参数名称 |
参数值 |
说明 |
| userName |
admin |
用户名 |
| password |
admin |
密码 |
1.5 返回报文
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">-6023247882450017834</ns1:sessionID> </soapenv:Header> <soapenv:Body> <logInResponse xmlns="http://ws.polarion.com/SessionWebService-impl"/> </soapenv:Body></soapenv:Envelope>
2 修改数据请求
在进行所有数据写入之前,必须发起该请求
2.1 请求地址
http://alm.moelab.cn/polarion/ws/services/SessionWebService
2.2 请求方式
POST
2.3 请求头
SOAPAction : http://alm.moelab.cn/polarion/ws/services/SessionWebService
2.4 请求报文
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ses="http://ws.polarion.com/SessionWebService-impl"> <soapenv:Header> <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">SESSIONID</ns1:sessionID> </soapenv:Header> <soapenv:Body> <ses:beginTransaction/> </soapenv:Body></soapenv:Envelope>
| 参数名称 |
参数值 |
说明 |
| sessionID |
SESSIONID |
1.5 报文中获取的SessionID |
2.5 返回报文
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">-6023247882450017834</ns1:sessionID> </soapenv:Header> <soapenv:Body> <beginTransactionResponse xmlns="http://ws.polarion.com/SessionWebService-impl"/> </soapenv:Body></soapenv:Envelope>
3 提交数据修改
完成数据修改之后,需要提交数据修改才能生效
3.1 请求地址
http://alm.moelab.cn/polarion/ws/services/SessionWebService
3.2 请求方式
POST
3.3 请求头
SOAPAction : http://alm.moelab.cn/polarion/ws/services/SessionWebService
3.4 请求报文
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ses="http://ws.polarion.com/SessionWebService-impl"> <soapenv:Header> <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">SESSIONID</ns1:sessionID> </soapenv:Header> <soapenv:Body> <ses:endTransaction> <ses:rollback>false</ses:rollback> </ses:endTransaction> </soapenv:Body></soapenv:Envelope>
| 参数名称 |
参数值 |
说明 |
| sessionID |
SESSIONID |
1.5 报文中获取的SessionID |
3.5 返回报文
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">-6023247882450017834</ns1:sessionID> </soapenv:Header> <soapenv:Body> <endTransactionResponse xmlns="http://ws.polarion.com/SessionWebService-impl"/> </soapenv:Body></soapenv:Envelope>
4 获取项目接口
4.1 请求地址
http://alm.moelab.cn/polarion/ws/services/ProjectWebService
4.2 请求方式
POST
4.3 请求头
SOAPAction : http://alm.moelab.cn/polarion/ws/services/ProjectWebService
4.4 请求报文
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proj="http://ws.polarion.com/ProjectWebService-impl"> <soapenv:Header> <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">SESSIONID</ns1:sessionID> </soapenv:Header> <soapenv:Body> <proj:getContainedProjects> <proj:projectGroupURI>subterra:data-service:objects:/default/${ProjectGroup}Group</proj:projectGroupURI> </proj:getContainedProjects> </soapenv:Body></soapenv:Envelope>
| 参数名称 |
参数值 |
说明 |
| sessionID |
SESSIONID |
1.5 报文中获取的SessionID |
4.5 返回报文
报文中返回了两个项目信息,ASPICE和Test
| 参数名称 |
类型 |
参数值 |
说明 |
| uri |
string |
subterra:data-service:objects:/default/ASPICE${Project}ASPICE |
项目内部URI |
| active |
string |
true |
项目是否激活 |
| id |
string |
ASPICE |
项目ID |
| name |
string |
ASPICE |
项目名称 |
| trackerPrefix |
string |
ASPICE |
项目工作项前缀 |
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <getContainedProjectsResponse xmlns="http://ws.polarion.com/ProjectWebService-impl"> <getContainedProjectsReturn uri="subterra:data-service:objects:/default/ASPICE${Project}ASPICE" unresolvable="false" xmlns:ns1="http://ws.polarion.com/types" xmlns:ns2="http://ws.polarion.com/ProjectWebService-types"> <ns2:active>true</ns2:active> <ns2:id>ASPICE</ns2:id> <ns2:lead uri="subterra:data-service:objects:/default/${User}admin" unresolvable="false"> <ns2:disabledNotifications>false</ns2:disabledNotifications> <ns2:id>admin</ns2:id> <ns2:name>System Administrator</ns2:name> <ns2:voteURIs/> <ns2:watcheURIs/> </ns2:lead> <ns2:location>default:/ASPICE/.polarion/polarion-project.xml</ns2:location> <ns2:name>ASPICE</ns2:name> <ns2:projectGroupURI>subterra:data-service:objects:/default/${ProjectGroup}Group</ns2:projectGroupURI> <ns2:start>2020-04-07</ns2:start> <ns2:trackerPrefix>ASPICE</ns2:trackerPrefix> </getContainedProjectsReturn> <getContainedProjectsReturn uri="subterra:data-service:objects:/default/Test${Project}Test" unresolvable="false" xmlns:ns3="http://ws.polarion.com/types" xmlns:ns4="http://ws.polarion.com/ProjectWebService-types"> <ns4:active>true</ns4:active> <ns4:description> <ns3:type>text/plain</ns3:type> <ns3:content>This text comes from the project's Description in the Administration perspective.</ns3:content> <ns3:contentLossy>false</ns3:contentLossy> </ns4:description> <ns4:id>Test</ns4:id> <ns4:lead uri="subterra:data-service:objects:/default/${User}admin" unresolvable="false"> <ns4:disabledNotifications>false</ns4:disabledNotifications> <ns4:id>admin</ns4:id> <ns4:name>System Administrator</ns4:name> <ns4:voteURIs/> <ns4:watcheURIs/> </ns4:lead> <ns4:location>default:/Test/.polarion/polarion-project.xml</ns4:location> <ns4:name>Test</ns4:name> <ns4:projectGroupURI>subterra:data-service:objects:/default/${ProjectGroup}Group</ns4:projectGroupURI> <ns4:start>2020-06-30</ns4:start> <ns4:trackerPrefix>TEST</ns4:trackerPrefix> </getContainedProjectsReturn> </getContainedProjectsResponse> </soapenv:Body></soapenv:Envelope>
5 获取测试执行清单
5.1 请求地址
http://alm.moelab.cn/polarion/ws/services/TestManagementWebService
5.2 请求方式
POST
5.3 请求头
SOAPAction : http://alm.moelab.cn/polarion/ws/services/TestManagementWebService
5.4 请求报文
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tes="http://ws.polarion.com/TestManagementWebService-impl"> <soapenv:Header> <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">SESSIONID</ns1:sessionID> </soapenv:Header> <soapenv:Body> <tes:searchTestRuns> <tes:query>project.id:ASPICE</tes:query> </tes:searchTestRuns> </soapenv:Body></soapenv:Envelope>
| 参数名称 |
参数值 |
说明 |
| sessionID |
SESSIONID |
1.5 报文中获取的SessionID |
| query |
project.id:ASPICE |
需要检索的项目,此处为ASPICE |
5.5 返回报文
| 参数名称 |
类型 |
参数值 |
说明 |
| uri |
string |
subterra:data-service:objects:/default/ASPICE${TestRun}0001 |
测试执行内部URI |
| authorURI |
string |
subterra:data-service:objects:/default/${User}admin |
测试执行作者内部URI |
| created |
string |
2020-06-30T07:10:33.654Z |
创建时间 |
| id |
string |
0001 |
测试执行ID |
| status |
string |
open |
测试执行状态 |
| title |
string |
软件集成测试用例 |
测试执行标题,UTF-8编码后的字符串 |
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <searchTestRunsResponse xmlns="http://ws.polarion.com/TestManagementWebService-impl"> <searchTestRunsReturn uri="subterra:data-service:objects:/default/ASPICE${TestRun}0001" unresolvable="false" xmlns:ns1="http://ws.polarion.com/types" xmlns:ns2="http://ws.polarion.com/ProjectWebService-types" xmlns:ns3="http://ws.polarion.com/TestManagementWebService-types"> <ns3:attachments/> <ns3:authorURI>subterra:data-service:objects:/default/${User}admin</ns3:authorURI> <ns3:comments/> <ns3:created>2020-06-30T07:10:33.654Z</ns3:created> <ns3:id>0001</ns3:id> <ns3:isTemplate>false</ns3:isTemplate> <ns3:keepInHistory>false</ns3:keepInHistory> <ns3:location>default:/ASPICE/.polarion/testing/testruns/0001/testrun.xml</ns3:location> <ns3:projectURI>subterra:data-service:objects:/default/ASPICE${Project}ASPICE</ns3:projectURI> <ns3:projectSpanURIs/> <ns3:query>type:software_integration_test_case</ns3:query> <ns3:records/> <ns3:selectTestCasesBy> <ns4:id xmlns:ns4="http://ws.polarion.com/TrackerWebService-types">staticQueryResult</ns4:id> </ns3:selectTestCasesBy> <ns3:status> <ns5:id xmlns:ns5="http://ws.polarion.com/TrackerWebService-types">open</ns5:id> </ns3:status> <ns3:templateURI>subterra:data-service:objects:/default/ASPICE${TestRun}software_integration_test</ns3:templateURI> <ns3:title>软件集成测试用例</ns3:title> <ns3:type> <ns6:id xmlns:ns6="http://ws.polarion.com/TrackerWebService-types">manual</ns6:id> </ns3:type> <ns3:updated>2020-06-30T07:10:33.700Z</ns3:updated> <ns3:useReportFromTemplate>true</ns3:useReportFromTemplate> </searchTestRunsReturn> <searchTestRunsReturn uri="subterra:data-service:objects:/default/ASPICE${TestRun}00001" unresolvable="false" xmlns:ns7="http://ws.polarion.com/types" xmlns:ns8="http://ws.polarion.com/ProjectWebService-types" xmlns:ns9="http://ws.polarion.com/TestManagementWebService-types"> <ns9:attachments/> <ns9:authorURI>subterra:data-service:objects:/default/${User}admin</ns9:authorURI> <ns9:comments/> <ns9:created>2020-05-05T13:39:06.477Z</ns9:created> <ns9:id>00001</ns9:id> <ns9:isTemplate>false</ns9:isTemplate> <ns9:keepInHistory>false</ns9:keepInHistory> <ns9:location>default:/ASPICE/.polarion/testing/testruns/00001/testrun.xml</ns9:location> <ns9:projectURI>subterra:data-service:objects:/default/ASPICE${Project}ASPICE</ns9:projectURI> <ns9:projectSpanURIs/> <ns9:query>type:software_integration_test_case</ns9:query> <ns9:records/> <ns9:selectTestCasesBy> <ns10:id xmlns:ns10="http://ws.polarion.com/TrackerWebService-types">staticQueryResult</ns10:id> </ns9:selectTestCasesBy> <ns9:status> <ns11:id xmlns:ns11="http://ws.polarion.com/TrackerWebService-types">open</ns11:id> </ns9:status> <ns9:templateURI>subterra:data-service:objects:/default/ASPICE${TestRun}software_integration_test</ns9:templateURI> <ns9:title>软件集成测试用例</ns9:title> <ns9:type> <ns12:id xmlns:ns12="http://ws.polarion.com/TrackerWebService-types">manual</ns12:id> </ns9:type> <ns9:updated>2020-05-05T13:39:06.496Z</ns9:updated> <ns9:useReportFromTemplate>true</ns9:useReportFromTemplate> </searchTestRunsReturn> <searchTestRunsReturn uri="subterra:data-service:objects:/default/ASPICE${TestRun}00002" unresolvable="false" xmlns:ns13="http://ws.polarion.com/types" xmlns:ns14="http://ws.polarion.com/ProjectWebService-types" xmlns:ns15="http://ws.polarion.com/TestManagementWebService-types"> <ns15:attachments/> <ns15:authorURI>subterra:data-service:objects:/default/${User}admin</ns15:authorURI> <ns15:comments/> <ns15:created>2020-05-05T13:39:15.708Z</ns15:created> <ns15:id>00002</ns15:id> <ns15:isTemplate>false</ns15:isTemplate> <ns15:keepInHistory>false</ns15:keepInHistory> <ns15:location>default:/ASPICE/.polarion/testing/testruns/00002/testrun.xml</ns15:location> <ns15:projectURI>subterra:data-service:objects:/default/ASPICE${Project}ASPICE</ns15:projectURI> <ns15:projectSpanURIs/> <ns15:query>type:software_integration_test_case</ns15:query> <ns15:records/> <ns15:selectTestCasesBy> <ns16:id xmlns:ns16="http://ws.polarion.com/TrackerWebService-types">staticQueryResult</ns16:id> </ns15:selectTestCasesBy> <ns15:status> <ns17:id xmlns:ns17="http://ws.polarion.com/TrackerWebService-types">open</ns17:id> </ns15:status> <ns15:templateURI>subterra:data-service:objects:/default/ASPICE${TestRun}software_integration_test</ns15:templateURI> <ns15:title>软件集成测试用例</ns15:title> <ns15:type> <ns18:id xmlns:ns18="http://ws.polarion.com/TrackerWebService-types">manual</ns18:id> </ns15:type> <ns15:updated>2020-05-05T13:39:15.724Z</ns15:updated> <ns15:useReportFromTemplate>true</ns15:useReportFromTemplate> </searchTestRunsReturn> <searchTestRunsReturn uri="subterra:data-service:objects:/default/ASPICE${TestRun}00003" unresolvable="false" xmlns:ns19="http://ws.polarion.com/types" xmlns:ns20="http://ws.polarion.com/ProjectWebService-types" xmlns:ns21="http://ws.polarion.com/TestManagementWebService-types"> <ns21:attachments/> <ns21:authorURI>subterra:data-service:objects:/default/${User}admin</ns21:authorURI> <ns21:comments/> <ns21:created>2020-05-05T13:39:34.035Z</ns21:created> <ns21:id>00003</ns21:id> <ns21:isTemplate>false</ns21:isTemplate> <ns21:keepInHistory>false</ns21:keepInHistory> <ns21:location>default:/ASPICE/.polarion/testing/testruns/00003/testrun.xml</ns21:location> <ns21:projectURI>subterra:data-service:objects:/default/ASPICE${Project}ASPICE</ns21:projectURI> <ns21:projectSpanURIs/> <ns21:query>type:software_unit_test_case</ns21:query> <ns21:records/> <ns21:selectTestCasesBy> <ns22:id xmlns:ns22="http://ws.polarion.com/TrackerWebService-types">staticQueryResult</ns22:id> </ns21:selectTestCasesBy> <ns21:status> <ns23:id xmlns:ns23="http://ws.polarion.com/TrackerWebService-types">open</ns23:id> </ns21:status> <ns21:templateURI>subterra:data-service:objects:/default/ASPICE${TestRun}software_unit_test</ns21:templateURI> <ns21:title>软件单元测试</ns21:title> <ns21:type> <ns24:id xmlns:ns24="http://ws.polarion.com/TrackerWebService-types">manual</ns24:id> </ns21:type> <ns21:updated>2020-05-05T13:39:34.052Z</ns21:updated> <ns21:useReportFromTemplate>true</ns21:useReportFromTemplate> </searchTestRunsReturn> </searchTestRunsResponse> </soapenv:Body></soapenv:Envelope>
6 获取测试执行信息
根据测试执行URI,获得测试执行信息
6.1 请求地址
http://alm.moelab.cn/polarion/ws/services/TestManagementWebService
6.2 请求方式
POST
6.3 请求头
SOAPAction : http://alm.moelab.cn/polarion/ws/services/TestManagementWebService
6.4 请求报文
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tes="http://ws.polarion.com/TestManagementWebService-impl"> <soapenv:Header> <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">SESSIONID</ns1:sessionID> </soapenv:Header> <soapenv:Body> <tes:getTestRunByUri> <tes:uri>subterra:data-service:objects:/default/Test${TestRun}T5</tes:uri> </tes:getTestRunByUri> </soapenv:Body></soapenv:Envelope>
| 参数名称 |
参数值 |
说明 |
| sessionID |
SESSIONID |
1.5 报文中获取的SessionID |
| uri |
subterra:data-service:objects:/default/Test${TestRun}T5 |
测试执行的内部URI |
6.5 返回报文
| 参数名称 |
类型 |
参数值 |
说明 |
| uri |
string |
subterra:data-service:objects:/default/Test${TestRun}T7 |
测试执行内部URI |
| authorURI |
string |
subterra:data-service:objects:/default/${User}admin |
测试执行作者内部URI |
| created |
string |
2020-05-21T11:07:58.522Z |
创建时间 |
| id |
string |
0001 |
测试执行ID |
| status |
string |
open |
测试执行状态 |
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <getTestRunByUriResponse xmlns="http://ws.polarion.com/TestManagementWebService-impl"> <getTestRunByUriReturn uri="subterra:data-service:objects:/default/Test${TestRun}T7" unresolvable="false" xsi:type="ns3:TestRun" xmlns:ns1="http://ws.polarion.com/types" xmlns:ns2="http://ws.polarion.com/ProjectWebService-types" xmlns:ns3="http://ws.polarion.com/TestManagementWebService-types"> <ns3:attachments/> <ns3:authorURI>subterra:data-service:objects:/default/${User}admin</ns3:authorURI> <ns3:comments/> <ns3:created>2020-05-21T11:07:58.522Z</ns3:created> <ns3:groupId>- - enter build id - -</ns3:groupId> <ns3:id>T7</ns3:id> <ns3:isTemplate>false</ns3:isTemplate> <ns3:keepInHistory>false</ns3:keepInHistory> <ns3:location>default:/Test/.polarion/testing/testruns/T7/testrun.xml</ns3:location> <ns3:projectURI>subterra:data-service:objects:/default/Test${Project}Test</ns3:projectURI> <ns3:projectSpanURIs/> <ns3:records/> <ns3:selectTestCasesBy> <ns4:id xmlns:ns4="http://ws.polarion.com/TrackerWebService-types">manualSelection</ns4:id> </ns3:selectTestCasesBy> <ns3:status> <ns5:id xmlns:ns5="http://ws.polarion.com/TrackerWebService-types">open</ns5:id> </ns3:status> <ns3:templateURI>subterra:data-service:objects:/default/Test${TestRun}Empty</ns3:templateURI> <ns3:type> <ns6:id xmlns:ns6="http://ws.polarion.com/TrackerWebService-types">manual</ns6:id> </ns3:type> <ns3:updated>2020-05-21T11:07:58.541Z</ns3:updated> <ns3:useReportFromTemplate>true</ns3:useReportFromTemplate> <ns3:customFields> <ns7:Custom xmlns:ns7="http://ws.polarion.com/TrackerWebService-types"> <ns7:key>description</ns7:key> <ns7:value xsi:type="ns1:Text"> <ns1:type xsi:type="xsd:string">text/html</ns1:type> <ns1:content xsi:type="xsd:string"><html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta content="HTML Tidy for Java (vers. 26 Sep 2004), see www.w3.org" name="generator"><title></title></head><body>​<span style="font-style: italic;" last_known_index="1">Click "Properties" and provide a short description of the software being tested and the test design itself.</span></body></html></ns1:content> <ns1:contentLossy xsi:type="xsd:boolean">false</ns1:contentLossy> </ns7:value> </ns7:Custom> <ns8:Custom xmlns:ns8="http://ws.polarion.com/TrackerWebService-types"> <ns8:key>goal</ns8:key> <ns8:value xsi:type="ns1:Text"> <ns1:type xsi:type="xsd:string">text/html</ns1:type> <ns1:content xsi:type="xsd:string"><html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta content="HTML Tidy for Java (vers. 26 Sep 2004), see www.w3.org" name="generator"><title></title></head><body>​​<span style="font-style: italic;" last_known_index="1">Describe the hi-level goals of this test and pass/fail criteria.</span></body></html></ns1:content> <ns1:contentLossy xsi:type="xsd:boolean">false</ns1:contentLossy> </ns8:value> </ns8:Custom> </ns3:customFields> </getTestRunByUriReturn> </getTestRunByUriResponse> </soapenv:Body></soapenv:Envelope>
7 获取测试用例清单
7.1 请求地址
http://alm.moelab.cn/polarion/ws/services/TrackerWebService
7.2 请求方式
POST
7.3 请求头
SOAPAction : http://alm.moelab.cn/polarion/ws/services/TrackerWebService
7.4 请求报文
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:trac="http://ws.polarion.com/TrackerWebService-impl"> <soapenv:Header> <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">SESSIONID</ns1:sessionID> </soapenv:Header> <soapenv:Body> <trac:queryWorkItems> <trac:query>project.id:ASPICE AND type:system_requirements</trac:query> <trac:sort>id</trac:sort> <trac:fields>id</trac:fields> <trac:fields>title</trac:fields> <trac:fields>status</trac:fields> </trac:queryWorkItems> </soapenv:Body></soapenv:Envelope>
| 参数名称 |
参数值 |
说明 |
| sessionID |
SESSIONID |
1.5 报文中获取的SessionID |
| query |
project.id:ASPICE AND type:system_requirements |
需要检索的项目和测试用例类型,此处为ASPICE项目,测试用例类型为system_requirements |
7.5 返回报文
| 参数名称 |
类型 |
参数值 |
说明 |
| uri |
string |
subterra:data-service:objects:/default/ASPICE${WorkItem}ASPICE-157 |
测试用例内部工作项 |
| id |
string |
ASPICE-157 |
测试用例的id |
| status.id |
string |
draft |
测试用例的状态,此处为draft |
| title |
string |
0 |
测试用例的标题 |
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <queryWorkItemsResponse xmlns="http://ws.polarion.com/TrackerWebService-impl"> <queryWorkItemsReturn uri="subterra:data-service:objects:/default/ASPICE${WorkItem}ASPICE-157" unresolvable="false" xmlns:ns1="http://ws.polarion.com/types" xmlns:ns2="http://ws.polarion.com/ProjectWebService-types" xmlns:ns3="http://ws.polarion.com/TrackerWebService-types"> <ns3:id>ASPICE-157</ns3:id> <ns3:status> <ns3:id>draft</ns3:id> </ns3:status> <ns3:title>0</ns3:title> </queryWorkItemsReturn> </queryWorkItemsResponse> </soapenv:Body></soapenv:Envelope>
8 在测试执行中新增测试记录
在指定的测试执行中,增加测试记录
8.1 请求地址
http://alm.moelab.cn/polarion/ws/services/TestManagementWebService
8.2 请求方式
POST
8.3 请求头
SOAPAction : http://alm.moelab.cn/polarion/ws/services/TestManagementWebService
8.4 请求报文
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tes="http://ws.polarion.com/TestManagementWebService-impl" xmlns:tes1="http://ws.polarion.com/TestManagementWebService-types" xmlns:trac="http://ws.polarion.com/TrackerWebService-types" xmlns:proj="http://ws.polarion.com/ProjectWebService-types" xmlns:typ="http://ws.polarion.com/types"> <soapenv:Header> <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">SESSIONID</ns1:sessionID> </soapenv:Header> <soapenv:Body> <tes:executeTest> <tes:testRunUri>subterra:data-service:objects:/default/Test${TestRun}T8</tes:testRunUri> <tes:testRecords> <tes1:duration>19.0</tes1:duration> <tes1:executed>2020-07-13T17:06:02.513Z</tes1:executed> <tes1:executedByURI>subterra:data-service:objects:/default/${User}admin</tes1:executedByURI> <tes1:result> <trac:id>passed</trac:id> </tes1:result> <tes1:testCaseURI>subterra:data-service:objects:/default/Test${WorkItem}TEST-513</tes1:testCaseURI> <tes1:testStepResults> <tes1:TestStepResult> <tes1:comment> <typ:type>text/html</typ:type> <typ:content>AR1</typ:content> <typ:contentLossy>false</typ:contentLossy> </tes1:comment> <tes1:result> <trac:id>passed</trac:id> </tes1:result> </tes1:TestStepResult> <tes1:TestStepResult> <tes1:comment> <typ:type>text/html</typ:type> <typ:content>AR2</typ:content> <typ:contentLossy>false</typ:contentLossy> </tes1:comment> <tes1:result> <trac:id>failed</trac:id> </tes1:result> </tes1:TestStepResult> <tes1:TestStepResult> <tes1:comment> <typ:type>text/html</typ:type> <typ:content>AR3</typ:content> <typ:contentLossy>false</typ:contentLossy> </tes1:comment> <tes1:result> <trac:id>blocked</trac:id> </tes1:result> </tes1:TestStepResult> </tes1:testStepResults> </tes:testRecords> </tes:executeTest> </soapenv:Body></soapenv:Envelope>
| 参数名称 |
参数值 |
说明 |
| sessionID |
SESSIONID |
1.5 报文中获取的SessionID |
| testRunUri |
subterra:data-service:objects:/default/Test${TestRun}T8 |
测试执行URI |
| duration |
19.0 |
测试执行持续时间 |
| executed |
2020-07-13T17:06:02.513Z |
测试执行时间 |
| executedByURI |
subterra:data-service:objects:/default/${User}admin |
测试执行人员的内部URI |
| result.id |
passed |
测试执行的结果 |
| testCaseURI |
subterra:data-service:objects:/default/Test${WorkItem}TEST-513 |
测试用例的内部URI |
| testStepResults.TestStepResult.comment.content |
AR1 |
测试步骤的测试结果 |
| testStepResults.TestStepResult.result.id |
passed |
测试步骤的结果 |
8.5 返回报文
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <executeTestResponse xmlns="http://ws.polarion.com/TestManagementWebService-impl"/> </soapenv:Body></soapenv:Envelope>