0 环境描述

本文档中,所使用的测试环境地址为http://alm.moelab.cn/polarion/

0.1 接口调用逻辑顺序

image.png

1 登陆接口

登陆Polarion系统,获取SessionID

1.1 请求地址

http://alm.moelab.cn/polarion/ws/services/SessionWebService

1.2 请求方式

POST

1.3 请求头

  1. SOAPAction : http://alm.moelab.cn/polarion/ws/services/SessionWebService

1.4 请求报文

  1. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ses="http://ws.polarion.com/SessionWebService-impl">
  2. <soapenv:Header/>
  3. <soapenv:Body>
  4. <ses:logIn>
  5. <ses:userName>admin</ses:userName>
  6. <ses:password>admin</ses:password>
  7. </ses:logIn>
  8. </soapenv:Body>
  9. </soapenv:Envelope>
参数名称 参数值 说明
userName admin 用户名
password admin 密码

1.5 返回报文

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <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">
  3. <soapenv:Header>
  4. <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">-6023247882450017834</ns1:sessionID>
  5. </soapenv:Header>
  6. <soapenv:Body>
  7. <logInResponse xmlns="http://ws.polarion.com/SessionWebService-impl"/>
  8. </soapenv:Body>
  9. </soapenv:Envelope>

2 修改数据请求

在进行所有数据写入之前,必须发起该请求

2.1 请求地址

http://alm.moelab.cn/polarion/ws/services/SessionWebService

2.2 请求方式

POST

2.3 请求头

  1. SOAPAction : http://alm.moelab.cn/polarion/ws/services/SessionWebService

2.4 请求报文

  1. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ses="http://ws.polarion.com/SessionWebService-impl">
  2. <soapenv:Header>
  3. <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">SESSIONID</ns1:sessionID>
  4. </soapenv:Header>
  5. <soapenv:Body>
  6. <ses:beginTransaction/>
  7. </soapenv:Body>
  8. </soapenv:Envelope>
参数名称 参数值 说明
sessionID SESSIONID 1.5 报文中获取的SessionID

2.5 返回报文

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <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">
  3. <soapenv:Header>
  4. <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">-6023247882450017834</ns1:sessionID>
  5. </soapenv:Header>
  6. <soapenv:Body>
  7. <beginTransactionResponse xmlns="http://ws.polarion.com/SessionWebService-impl"/>
  8. </soapenv:Body>
  9. </soapenv:Envelope>

3 提交数据修改

完成数据修改之后,需要提交数据修改才能生效

3.1 请求地址

http://alm.moelab.cn/polarion/ws/services/SessionWebService

3.2 请求方式

POST

3.3 请求头

  1. SOAPAction : http://alm.moelab.cn/polarion/ws/services/SessionWebService

3.4 请求报文

  1. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ses="http://ws.polarion.com/SessionWebService-impl">
  2. <soapenv:Header>
  3. <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">SESSIONID</ns1:sessionID>
  4. </soapenv:Header>
  5. <soapenv:Body>
  6. <ses:endTransaction>
  7. <ses:rollback>false</ses:rollback>
  8. </ses:endTransaction>
  9. </soapenv:Body>
  10. </soapenv:Envelope>
参数名称 参数值 说明
sessionID SESSIONID 1.5 报文中获取的SessionID

3.5 返回报文

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <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">
  3. <soapenv:Header>
  4. <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">-6023247882450017834</ns1:sessionID>
  5. </soapenv:Header>
  6. <soapenv:Body>
  7. <endTransactionResponse xmlns="http://ws.polarion.com/SessionWebService-impl"/>
  8. </soapenv:Body>
  9. </soapenv:Envelope>

4 获取项目接口

4.1 请求地址

http://alm.moelab.cn/polarion/ws/services/ProjectWebService

4.2 请求方式

POST

4.3 请求头

  1. SOAPAction : http://alm.moelab.cn/polarion/ws/services/ProjectWebService

4.4 请求报文

  1. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proj="http://ws.polarion.com/ProjectWebService-impl">
  2. <soapenv:Header>
  3. <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">SESSIONID</ns1:sessionID>
  4. </soapenv:Header>
  5. <soapenv:Body>
  6. <proj:getContainedProjects>
  7. <proj:projectGroupURI>subterra:data-service:objects:/default/${ProjectGroup}Group</proj:projectGroupURI>
  8. </proj:getContainedProjects>
  9. </soapenv:Body>
  10. </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 项目工作项前缀
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <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">
  3. <soapenv:Body>
  4. <getContainedProjectsResponse xmlns="http://ws.polarion.com/ProjectWebService-impl">
  5. <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">
  6. <ns2:active>true</ns2:active>
  7. <ns2:id>ASPICE</ns2:id>
  8. <ns2:lead uri="subterra:data-service:objects:/default/${User}admin" unresolvable="false">
  9. <ns2:disabledNotifications>false</ns2:disabledNotifications>
  10. <ns2:id>admin</ns2:id>
  11. <ns2:name>System Administrator</ns2:name>
  12. <ns2:voteURIs/>
  13. <ns2:watcheURIs/>
  14. </ns2:lead>
  15. <ns2:location>default:/ASPICE/.polarion/polarion-project.xml</ns2:location>
  16. <ns2:name>ASPICE</ns2:name>
  17. <ns2:projectGroupURI>subterra:data-service:objects:/default/${ProjectGroup}Group</ns2:projectGroupURI>
  18. <ns2:start>2020-04-07</ns2:start>
  19. <ns2:trackerPrefix>ASPICE</ns2:trackerPrefix>
  20. </getContainedProjectsReturn>
  21. <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">
  22. <ns4:active>true</ns4:active>
  23. <ns4:description>
  24. <ns3:type>text/plain</ns3:type>
  25. <ns3:content>This text comes from the project's Description in the Administration perspective.</ns3:content>
  26. <ns3:contentLossy>false</ns3:contentLossy>
  27. </ns4:description>
  28. <ns4:id>Test</ns4:id>
  29. <ns4:lead uri="subterra:data-service:objects:/default/${User}admin" unresolvable="false">
  30. <ns4:disabledNotifications>false</ns4:disabledNotifications>
  31. <ns4:id>admin</ns4:id>
  32. <ns4:name>System Administrator</ns4:name>
  33. <ns4:voteURIs/>
  34. <ns4:watcheURIs/>
  35. </ns4:lead>
  36. <ns4:location>default:/Test/.polarion/polarion-project.xml</ns4:location>
  37. <ns4:name>Test</ns4:name>
  38. <ns4:projectGroupURI>subterra:data-service:objects:/default/${ProjectGroup}Group</ns4:projectGroupURI>
  39. <ns4:start>2020-06-30</ns4:start>
  40. <ns4:trackerPrefix>TEST</ns4:trackerPrefix>
  41. </getContainedProjectsReturn>
  42. </getContainedProjectsResponse>
  43. </soapenv:Body>
  44. </soapenv:Envelope>

5 获取测试执行清单

5.1 请求地址

http://alm.moelab.cn/polarion/ws/services/TestManagementWebService

5.2 请求方式

POST

5.3 请求头

  1. SOAPAction : http://alm.moelab.cn/polarion/ws/services/TestManagementWebService

5.4 请求报文

  1. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tes="http://ws.polarion.com/TestManagementWebService-impl">
  2. <soapenv:Header>
  3. <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">SESSIONID</ns1:sessionID>
  4. </soapenv:Header>
  5. <soapenv:Body>
  6. <tes:searchTestRuns>
  7. <tes:query>project.id:ASPICE</tes:query>
  8. </tes:searchTestRuns>
  9. </soapenv:Body>
  10. </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编码后的字符串
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <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">
  3. <soapenv:Body>
  4. <searchTestRunsResponse xmlns="http://ws.polarion.com/TestManagementWebService-impl">
  5. <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">
  6. <ns3:attachments/>
  7. <ns3:authorURI>subterra:data-service:objects:/default/${User}admin</ns3:authorURI>
  8. <ns3:comments/>
  9. <ns3:created>2020-06-30T07:10:33.654Z</ns3:created>
  10. <ns3:id>0001</ns3:id>
  11. <ns3:isTemplate>false</ns3:isTemplate>
  12. <ns3:keepInHistory>false</ns3:keepInHistory>
  13. <ns3:location>default:/ASPICE/.polarion/testing/testruns/0001/testrun.xml</ns3:location>
  14. <ns3:projectURI>subterra:data-service:objects:/default/ASPICE${Project}ASPICE</ns3:projectURI>
  15. <ns3:projectSpanURIs/>
  16. <ns3:query>type:software_integration_test_case</ns3:query>
  17. <ns3:records/>
  18. <ns3:selectTestCasesBy>
  19. <ns4:id xmlns:ns4="http://ws.polarion.com/TrackerWebService-types">staticQueryResult</ns4:id>
  20. </ns3:selectTestCasesBy>
  21. <ns3:status>
  22. <ns5:id xmlns:ns5="http://ws.polarion.com/TrackerWebService-types">open</ns5:id>
  23. </ns3:status>
  24. <ns3:templateURI>subterra:data-service:objects:/default/ASPICE${TestRun}software_integration_test</ns3:templateURI>
  25. <ns3:title>&#x8F6F;&#x4EF6;&#x96C6;&#x6210;&#x6D4B;&#x8BD5;&#x7528;&#x4F8B;</ns3:title>
  26. <ns3:type>
  27. <ns6:id xmlns:ns6="http://ws.polarion.com/TrackerWebService-types">manual</ns6:id>
  28. </ns3:type>
  29. <ns3:updated>2020-06-30T07:10:33.700Z</ns3:updated>
  30. <ns3:useReportFromTemplate>true</ns3:useReportFromTemplate>
  31. </searchTestRunsReturn>
  32. <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">
  33. <ns9:attachments/>
  34. <ns9:authorURI>subterra:data-service:objects:/default/${User}admin</ns9:authorURI>
  35. <ns9:comments/>
  36. <ns9:created>2020-05-05T13:39:06.477Z</ns9:created>
  37. <ns9:id>00001</ns9:id>
  38. <ns9:isTemplate>false</ns9:isTemplate>
  39. <ns9:keepInHistory>false</ns9:keepInHistory>
  40. <ns9:location>default:/ASPICE/.polarion/testing/testruns/00001/testrun.xml</ns9:location>
  41. <ns9:projectURI>subterra:data-service:objects:/default/ASPICE${Project}ASPICE</ns9:projectURI>
  42. <ns9:projectSpanURIs/>
  43. <ns9:query>type:software_integration_test_case</ns9:query>
  44. <ns9:records/>
  45. <ns9:selectTestCasesBy>
  46. <ns10:id xmlns:ns10="http://ws.polarion.com/TrackerWebService-types">staticQueryResult</ns10:id>
  47. </ns9:selectTestCasesBy>
  48. <ns9:status>
  49. <ns11:id xmlns:ns11="http://ws.polarion.com/TrackerWebService-types">open</ns11:id>
  50. </ns9:status>
  51. <ns9:templateURI>subterra:data-service:objects:/default/ASPICE${TestRun}software_integration_test</ns9:templateURI>
  52. <ns9:title>&#x8F6F;&#x4EF6;&#x96C6;&#x6210;&#x6D4B;&#x8BD5;&#x7528;&#x4F8B;</ns9:title>
  53. <ns9:type>
  54. <ns12:id xmlns:ns12="http://ws.polarion.com/TrackerWebService-types">manual</ns12:id>
  55. </ns9:type>
  56. <ns9:updated>2020-05-05T13:39:06.496Z</ns9:updated>
  57. <ns9:useReportFromTemplate>true</ns9:useReportFromTemplate>
  58. </searchTestRunsReturn>
  59. <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">
  60. <ns15:attachments/>
  61. <ns15:authorURI>subterra:data-service:objects:/default/${User}admin</ns15:authorURI>
  62. <ns15:comments/>
  63. <ns15:created>2020-05-05T13:39:15.708Z</ns15:created>
  64. <ns15:id>00002</ns15:id>
  65. <ns15:isTemplate>false</ns15:isTemplate>
  66. <ns15:keepInHistory>false</ns15:keepInHistory>
  67. <ns15:location>default:/ASPICE/.polarion/testing/testruns/00002/testrun.xml</ns15:location>
  68. <ns15:projectURI>subterra:data-service:objects:/default/ASPICE${Project}ASPICE</ns15:projectURI>
  69. <ns15:projectSpanURIs/>
  70. <ns15:query>type:software_integration_test_case</ns15:query>
  71. <ns15:records/>
  72. <ns15:selectTestCasesBy>
  73. <ns16:id xmlns:ns16="http://ws.polarion.com/TrackerWebService-types">staticQueryResult</ns16:id>
  74. </ns15:selectTestCasesBy>
  75. <ns15:status>
  76. <ns17:id xmlns:ns17="http://ws.polarion.com/TrackerWebService-types">open</ns17:id>
  77. </ns15:status>
  78. <ns15:templateURI>subterra:data-service:objects:/default/ASPICE${TestRun}software_integration_test</ns15:templateURI>
  79. <ns15:title>&#x8F6F;&#x4EF6;&#x96C6;&#x6210;&#x6D4B;&#x8BD5;&#x7528;&#x4F8B;</ns15:title>
  80. <ns15:type>
  81. <ns18:id xmlns:ns18="http://ws.polarion.com/TrackerWebService-types">manual</ns18:id>
  82. </ns15:type>
  83. <ns15:updated>2020-05-05T13:39:15.724Z</ns15:updated>
  84. <ns15:useReportFromTemplate>true</ns15:useReportFromTemplate>
  85. </searchTestRunsReturn>
  86. <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">
  87. <ns21:attachments/>
  88. <ns21:authorURI>subterra:data-service:objects:/default/${User}admin</ns21:authorURI>
  89. <ns21:comments/>
  90. <ns21:created>2020-05-05T13:39:34.035Z</ns21:created>
  91. <ns21:id>00003</ns21:id>
  92. <ns21:isTemplate>false</ns21:isTemplate>
  93. <ns21:keepInHistory>false</ns21:keepInHistory>
  94. <ns21:location>default:/ASPICE/.polarion/testing/testruns/00003/testrun.xml</ns21:location>
  95. <ns21:projectURI>subterra:data-service:objects:/default/ASPICE${Project}ASPICE</ns21:projectURI>
  96. <ns21:projectSpanURIs/>
  97. <ns21:query>type:software_unit_test_case</ns21:query>
  98. <ns21:records/>
  99. <ns21:selectTestCasesBy>
  100. <ns22:id xmlns:ns22="http://ws.polarion.com/TrackerWebService-types">staticQueryResult</ns22:id>
  101. </ns21:selectTestCasesBy>
  102. <ns21:status>
  103. <ns23:id xmlns:ns23="http://ws.polarion.com/TrackerWebService-types">open</ns23:id>
  104. </ns21:status>
  105. <ns21:templateURI>subterra:data-service:objects:/default/ASPICE${TestRun}software_unit_test</ns21:templateURI>
  106. <ns21:title>&#x8F6F;&#x4EF6;&#x5355;&#x5143;&#x6D4B;&#x8BD5;</ns21:title>
  107. <ns21:type>
  108. <ns24:id xmlns:ns24="http://ws.polarion.com/TrackerWebService-types">manual</ns24:id>
  109. </ns21:type>
  110. <ns21:updated>2020-05-05T13:39:34.052Z</ns21:updated>
  111. <ns21:useReportFromTemplate>true</ns21:useReportFromTemplate>
  112. </searchTestRunsReturn>
  113. </searchTestRunsResponse>
  114. </soapenv:Body>
  115. </soapenv:Envelope>

6 获取测试执行信息

根据测试执行URI,获得测试执行信息

6.1 请求地址

http://alm.moelab.cn/polarion/ws/services/TestManagementWebService

6.2 请求方式

POST

6.3 请求头

  1. SOAPAction : http://alm.moelab.cn/polarion/ws/services/TestManagementWebService

6.4 请求报文

  1. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tes="http://ws.polarion.com/TestManagementWebService-impl">
  2. <soapenv:Header>
  3. <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">SESSIONID</ns1:sessionID>
  4. </soapenv:Header>
  5. <soapenv:Body>
  6. <tes:getTestRunByUri>
  7. <tes:uri>subterra:data-service:objects:/default/Test${TestRun}T5</tes:uri>
  8. </tes:getTestRunByUri>
  9. </soapenv:Body>
  10. </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 测试执行状态
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <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">
  3. <soapenv:Body>
  4. <getTestRunByUriResponse xmlns="http://ws.polarion.com/TestManagementWebService-impl">
  5. <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">
  6. <ns3:attachments/>
  7. <ns3:authorURI>subterra:data-service:objects:/default/${User}admin</ns3:authorURI>
  8. <ns3:comments/>
  9. <ns3:created>2020-05-21T11:07:58.522Z</ns3:created>
  10. <ns3:groupId>- - enter build id - -</ns3:groupId>
  11. <ns3:id>T7</ns3:id>
  12. <ns3:isTemplate>false</ns3:isTemplate>
  13. <ns3:keepInHistory>false</ns3:keepInHistory>
  14. <ns3:location>default:/Test/.polarion/testing/testruns/T7/testrun.xml</ns3:location>
  15. <ns3:projectURI>subterra:data-service:objects:/default/Test${Project}Test</ns3:projectURI>
  16. <ns3:projectSpanURIs/>
  17. <ns3:records/>
  18. <ns3:selectTestCasesBy>
  19. <ns4:id xmlns:ns4="http://ws.polarion.com/TrackerWebService-types">manualSelection</ns4:id>
  20. </ns3:selectTestCasesBy>
  21. <ns3:status>
  22. <ns5:id xmlns:ns5="http://ws.polarion.com/TrackerWebService-types">open</ns5:id>
  23. </ns3:status>
  24. <ns3:templateURI>subterra:data-service:objects:/default/Test${TestRun}Empty</ns3:templateURI>
  25. <ns3:type>
  26. <ns6:id xmlns:ns6="http://ws.polarion.com/TrackerWebService-types">manual</ns6:id>
  27. </ns3:type>
  28. <ns3:updated>2020-05-21T11:07:58.541Z</ns3:updated>
  29. <ns3:useReportFromTemplate>true</ns3:useReportFromTemplate>
  30. <ns3:customFields>
  31. <ns7:Custom xmlns:ns7="http://ws.polarion.com/TrackerWebService-types">
  32. <ns7:key>description</ns7:key>
  33. <ns7:value xsi:type="ns1:Text">
  34. <ns1:type xsi:type="xsd:string">text/html</ns1:type>
  35. <ns1:content xsi:type="xsd:string">&lt;html&gt;&lt;head&gt;&lt;META http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;&lt;meta content=&quot;HTML Tidy for Java (vers. 26 Sep 2004), see www.w3.org&quot; name=&quot;generator&quot;&gt;&lt;title&gt;&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&#x200B;&lt;span style=&quot;font-style: italic;&quot; last_known_index=&quot;1&quot;&gt;Click &quot;Properties&quot; and provide a short description of the software being tested and the test design itself.&lt;/span&gt;&lt;/body&gt;&lt;/html&gt;</ns1:content>
  36. <ns1:contentLossy xsi:type="xsd:boolean">false</ns1:contentLossy>
  37. </ns7:value>
  38. </ns7:Custom>
  39. <ns8:Custom xmlns:ns8="http://ws.polarion.com/TrackerWebService-types">
  40. <ns8:key>goal</ns8:key>
  41. <ns8:value xsi:type="ns1:Text">
  42. <ns1:type xsi:type="xsd:string">text/html</ns1:type>
  43. <ns1:content xsi:type="xsd:string">&lt;html&gt;&lt;head&gt;&lt;META http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;&lt;meta content=&quot;HTML Tidy for Java (vers. 26 Sep 2004), see www.w3.org&quot; name=&quot;generator&quot;&gt;&lt;title&gt;&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&#x200B;&#x200B;&lt;span style=&quot;font-style: italic;&quot; last_known_index=&quot;1&quot;&gt;Describe the hi-level goals of this test and pass/fail criteria.&lt;/span&gt;&lt;/body&gt;&lt;/html&gt;</ns1:content>
  44. <ns1:contentLossy xsi:type="xsd:boolean">false</ns1:contentLossy>
  45. </ns8:value>
  46. </ns8:Custom>
  47. </ns3:customFields>
  48. </getTestRunByUriReturn>
  49. </getTestRunByUriResponse>
  50. </soapenv:Body>
  51. </soapenv:Envelope>

7 获取测试用例清单

7.1 请求地址

http://alm.moelab.cn/polarion/ws/services/TrackerWebService

7.2 请求方式

POST

7.3 请求头

  1. SOAPAction : http://alm.moelab.cn/polarion/ws/services/TrackerWebService

7.4 请求报文

  1. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:trac="http://ws.polarion.com/TrackerWebService-impl">
  2. <soapenv:Header>
  3. <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">SESSIONID</ns1:sessionID>
  4. </soapenv:Header>
  5. <soapenv:Body>
  6. <trac:queryWorkItems>
  7. <trac:query>project.id:ASPICE AND type:system_requirements</trac:query>
  8. <trac:sort>id</trac:sort>
  9. <trac:fields>id</trac:fields>
  10. <trac:fields>title</trac:fields>
  11. <trac:fields>status</trac:fields>
  12. </trac:queryWorkItems>
  13. </soapenv:Body>
  14. </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 测试用例的标题
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <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">
  3. <soapenv:Body>
  4. <queryWorkItemsResponse xmlns="http://ws.polarion.com/TrackerWebService-impl">
  5. <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">
  6. <ns3:id>ASPICE-157</ns3:id>
  7. <ns3:status>
  8. <ns3:id>draft</ns3:id>
  9. </ns3:status>
  10. <ns3:title>0</ns3:title>
  11. </queryWorkItemsReturn>
  12. </queryWorkItemsResponse>
  13. </soapenv:Body>
  14. </soapenv:Envelope>

8 在测试执行中新增测试记录

在指定的测试执行中,增加测试记录

8.1 请求地址

http://alm.moelab.cn/polarion/ws/services/TestManagementWebService

8.2 请求方式

POST

8.3 请求头

  1. SOAPAction : http://alm.moelab.cn/polarion/ws/services/TestManagementWebService

8.4 请求报文

  1. <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">
  2. <soapenv:Header>
  3. <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://ws.polarion.com/session">SESSIONID</ns1:sessionID>
  4. </soapenv:Header>
  5. <soapenv:Body>
  6. <tes:executeTest>
  7. <tes:testRunUri>subterra:data-service:objects:/default/Test${TestRun}T8</tes:testRunUri>
  8. <tes:testRecords>
  9. <tes1:duration>19.0</tes1:duration>
  10. <tes1:executed>2020-07-13T17:06:02.513Z</tes1:executed>
  11. <tes1:executedByURI>subterra:data-service:objects:/default/${User}admin</tes1:executedByURI>
  12. <tes1:result>
  13. <trac:id>passed</trac:id>
  14. </tes1:result>
  15. <tes1:testCaseURI>subterra:data-service:objects:/default/Test${WorkItem}TEST-513</tes1:testCaseURI>
  16. <tes1:testStepResults>
  17. <tes1:TestStepResult>
  18. <tes1:comment>
  19. <typ:type>text/html</typ:type>
  20. <typ:content>AR1</typ:content>
  21. <typ:contentLossy>false</typ:contentLossy>
  22. </tes1:comment>
  23. <tes1:result>
  24. <trac:id>passed</trac:id>
  25. </tes1:result>
  26. </tes1:TestStepResult>
  27. <tes1:TestStepResult>
  28. <tes1:comment>
  29. <typ:type>text/html</typ:type>
  30. <typ:content>AR2</typ:content>
  31. <typ:contentLossy>false</typ:contentLossy>
  32. </tes1:comment>
  33. <tes1:result>
  34. <trac:id>failed</trac:id>
  35. </tes1:result>
  36. </tes1:TestStepResult>
  37. <tes1:TestStepResult>
  38. <tes1:comment>
  39. <typ:type>text/html</typ:type>
  40. <typ:content>AR3</typ:content>
  41. <typ:contentLossy>false</typ:contentLossy>
  42. </tes1:comment>
  43. <tes1:result>
  44. <trac:id>blocked</trac:id>
  45. </tes1:result>
  46. </tes1:TestStepResult>
  47. </tes1:testStepResults>
  48. </tes:testRecords>
  49. </tes:executeTest>
  50. </soapenv:Body>
  51. </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 返回报文

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <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">
  3. <soapenv:Body>
  4. <executeTestResponse xmlns="http://ws.polarion.com/TestManagementWebService-impl"/>
  5. </soapenv:Body>
  6. </soapenv:Envelope>