Alm Rest Api Documentation Download

Copy and paste this link to your website, so they can see this document directly without any plugins.



Keywords

test, Test, REST, instance, results, subtype-id, External, name, creating, that, Jenkins, TestProg1Prj1Test1_testMethod1, 2015-06-28, configuration, with, METHOD, entities, execution, 1049, Response, folder, resource, following, subtype, your, Generate, generate, Request, Accept=application/xml, Content-Type=application/xml

Transcript

Using HP ALM REST API to Synch Results from an External Testing
Framework
This document describes how to use ALM REST resources to upload external test results to
ALM. For more information on ALM REST API, see the HP ALM REST API documentation.
Who Should Use this Document?
ALM provides out-of-the-box integration with Jenkins to synch external results with ALM. This
document is intended for users who do not use Jenkins and would like to use ALM REST API to
synch results from their testing framework to ALM.
How to Integrate External Test Results to ALM
To upload your test results to ALM, you need to map your test suites to ALM External Test Sets
and map each test case to ALM External Test.
To do so, write a client-side parser to learn the entities from the result file and based on the
mapping, use ALM API (as described below) to generate the entities.
This step should be added as part of your automation process, so that after each test
execution, the client side parser will analyze the result file and call ALM rest API to generate the
relevant entities.
As a starting point, it is recommended you first import your results file to ALM to generate the
test sets, test instances and test entities (on the ALM sidebar, under Testing, select Test Lab.
Right-click a folder in the Test Set Tree and select Importing External Test Results).
Afterwards, use REST API to generate the run results of each execution.
Using Rest API to upload the results to ALM
After parsing the result file, the order for generating the entities is as follows:
1. Generate External Test entities (if they don’t already exist)
2. Generate External Test Set
3. Generate Test Instances for this Test Set
4. Generate Run entities.
Below you can find the technical details for generating the relevant entities for uploading
external test results to ALM.
1. Test
The REST resource for test is ‘test’. The subtype-id is ‘EXTERNAL-TEST’.
1.1 Fields
The following are fields for creating a test with subtype ‘EXTERNAL-TEST’:
Field Value
parent-id
The test folder Id of the test folder that
contains the test
Name The name of the test
subtype-id EXTERNAL-TEST
testing-framework The testing framework of the test
testing-tool The testing tool that is used to run the test
ut-package-name The package name of the test
ut-class-name The class name of the test
ut-method-name The method name of the test
Owner The test designer
1.2 Example:
URL
http://localhost:8085/qcbin/rest/domains/DEFAULT/projects/testexternal1/tests
METHOD
POST
Headers
X-QC-Ignore-Customizable-Required-Fields-Validation=Y
Content-Type=application/xml
Accept=application/xml
Request


TestProg1Prj1Test1_testMethod1
EXTERNAL-TEST
JUnit
Jenkins
prog1prj1
TestProg1Prj1Test1
testMethod1
1022 Name="owner">sa


Response


0



367
6





0
0

1

prog1prj1

testMethod1
1022
sa


49
1
49

TestProg1Prj1Test1_testMethod1
N

N

2015-06-28
TestProg1Prj1Test1
2015-06-28 22:42:15
JUnit
Jenkins

EXTERNAL-TEST
367
No Run


0




2. Test Set
The REST resource for test set is ‘test-set’. The subtype-id is ‘hp.qc.test-set.external’.
2.1 Fields
The following are fields for creating a test set with subtype ‘hp.qc.test-set.external’:
Field Value
parent-id The test set folder Id of the test set folder
that contains the test set
Name The name of the test set
subtype-id hp.qc.test-set.external
2.2 Example
URL
http://localhost:8085/qcbin/rest/domains/DEFAULT/projects/testexternal1/test-sets
METHOD
POST
Header
X-QC-Ignore-Customizable-Required-Fields-Validation=Y
Content-Type=application/xml
Accept=application/xml
Request


21
prog1prj1.TestProg1Prj1Test1
hp.qc.test-set.external


Response


0





701
1


prog1prj1.TestProg1Prj1Test1
N


2015-06-28 22:35:31

Open


2015-06-28

1
hp.qc.test-set.external
21





3. Test Configuration
The test configuration is automatically generated when creating a test. The REST resource for
test configuration is ‘test-config’. The following is an example of fetching the test configuration
of a given test. The test configuration Id is used when creating Test instance and Run.
3.1 Example
URL
http://localhost:8085/qcbin/rest/domains/DEFAULT/projects/testexternal1/testconfigs?query={parent-id[49]}&fields=id,name
METHOD
GET
Response



0

1049
TestProg1Prj1Test1_testMethod1



false

4. Test Instance
The REST resource for test instance is ‘test-instance’. The subtype-id is ‘hp.qc.testinstance.external-test’.
4.1 Fields
The following are fields for creating a test instance with subtype ‘hp.qc.test-instance.externaltest’:
Field Value
subtype-id hp.qc.test-instance.external-test
cycle-id
Test set Id of the test set that contains the
test instance
test-id
The test Id of the test instance
test-config-id
The test configuration Id of the test instance
exec-date
The execution date of the test instance
exec-time
The execution time of the test instance
owner
The owner of the test instance
4.2 Example
URL
http://localhost:8085/qcbin/rest/domains/DEFAULT/projects/testexternal1/test-instances
METHOD
POST
Header
X-QC-Ignore-Customizable-Required-Fields-Validation=Y
Content-Type=application/xml
Accept=application/xml
Request


701
1049
49
sa
hp.qc.test-instance.external-test


Response


0

1



49
1


1049

TestProg1Prj1Test1_testMethod1 [1]
N


701



2015-06-28 22:49:03
No Run





1
49
hp.qc.test-instance.external-test

sa




5. Run
The REST resource for run is ‘run’. The subtype-id is ‘hp.qc.run.external-test’.
5.1 Fields
The following are fields for creating a run with subtype ‘hp.qc.run.external-test’:
Field Value
subtype-id hp.qc.run.external-test
cycle-id The test set Id
testcycl-id The test instance Id
test-id The test Id
test-config-id The test configuration Id
execution-date The execution date
execution-time The execution time
status The status of the Run
detail The detail information of the run
duration The duration of the run execution
build-revision The build number of the run
jenkins-job-name The name of the Jenkins job that run the test
jenkins-url
The result page url of the Jenkins job
5.2 Example
URL
http://localhost:8085/qcbin/rest/domains/DEFAULT/projects/testexternal1/runs
METHOD
POST
Headers
X-QC-Ignore-Customizable-Required-Fields-Validation=Y
Content-Type=application/xml
Accept=application/xml
Request


1049
701
49
49
1
Import_Run_6-28_22-51-18
sa
Passed
hp.qc.run.external-test
Name="detail">PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxjYXNlPgogICAgPGR1cmF0aW9uPj
AuMDAyPC9kdXJhdGlvbj4KICAgIDxjbGFzc05hbWU+cHJvZzFwcmoxLlRlc3RQcm9nMVByajFUZXN
0MTwvY2xhc3NOYW1lPgogICAgPHRlc3ROYW1lPnRlc3RNZXRob2QxPC90ZXN0TmFtZT4KICAgID
xza2lwcGVkPmZhbHNlPC9za2lwcGVkPgogICAgPGZhaWxlZFNpbmNlPjA8L2ZhaWxlZFNpbmNlP
go8L2Nhc2U+

0
local
http://localhost:8085/
2015-05-12
12:23:27
Passed


Response


0

Name="detail">PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxjYXNlPgogICAgPGR1cmF0aW9uPj
AuMDAyPC9kdXJhdGlvbj4KICAgIDxjbGFzc05hbWU+cHJvZzFwcmoxLlRlc3RQcm9nMVByajFUZXN
0MTwvY2xhc3NOYW1lPgogICAgPHRlc3ROYW1lPnRlc3RNZXRob2QxPC90ZXN0TmFtZT4KICAgID
xza2lwcGVkPmZhbHNlPC9za2lwcGVkPgogICAgPGZhaWxlZFNpbmNlPjA8L2ZhaWxlZFNpbmNlP
go8L2Nhc2U+

1
2015-05-12
1
1



prog1prj1.TestProg1Prj1Test1
701


Passed

TestProg1Prj1Test1_testMethod1
49
local

sa

TestProg1Prj1Test1_testMethod1 [1]
12:23:27




53
1049
Import_Run_6-28_22-51-18
N
701_53



49

2015-06-28 22:53:13



hp.qc.run.external-test
N

0


http://localhost:8085/




Online Document Converter

This website help webmasters to achieve a better user experience. Instead of putting a link to download their prices lists and another type of documents, you can simply send a special link to this service, and we will show your document to your users directly without the need of downloading a special application or installing another browsers plugin. Currently, we can read about hundred the most used database files. Moreover, your users can share this document directly on social networks, giving your document additional page views. By using this service, you can save costs by not overloading your own web server, give your users a better way to read documents online without any problems, and allow them to easily download converted copy for offline reading in a format they like.


Previous 10

Next 10