Highlighted
Absent Member.
Absent Member.
496 views

PC / ALM API calls to retrieve number of scripts?

Jump to solution

Refers to ALM and Performance Center version 12.20

I am working with the API of both ALM and Performance Center to develop a reporting tool on the Performance Team's status and I am having a hard time trying to pull a specific metric, the number of scripts in a project.

I am able to find all the scripts associated with each test and I am able to successfully pull the list of active projects and the number of runs in each, but finding a way to pull the total number of scripts in each project has so far been elusive.

Any advice and request samples would be really helpful. Thanks!

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

Further analysis of the XML data set that gets returned from requesting 'tests' from the API has revealed an even better method to do this. Each entry has the tag:

<Field Name="subtype-id"><Value>

I have found these values based on what is the 'Test Plan'

    PERFORMANCE-TEST : test scenario

    DB-TEST : vugen test script

Why 'DB-TEST' is used to define a test script is beyond me, but I've gone through several projects in PC and confirmed this number is lining up correctly to the number of scripts in each project. So, by counting the number of of 'subtype-id' values with 'DB-TEST' I can now grab the total number of scripts and with the other value the total number of scenarios in any given project.

 

 

 

View solution in original post

0 Likes
3 Replies
Absent Member.
Absent Member.

Some of the documentation for ALM Performance Center makes reference to Scripts in the project as "Assets". So, does this mean in the API I should be requesting or querying the entity "Assests" for the service request? I did try this, but I'm not seeing any script details in the assets returned.

Am I even on the right track?

0 Likes
Highlighted
Absent Member.
Absent Member.

I think I finally cracked this nut. If anyone has a better way to pull this data or sees a reason why this won't work please point it out.

While it isn't obvious or simple, there is a way to pull the number of scripts in a project. What I do is submit this GET for each active project to the ALM API:
http://[ALM SERVER]:8080/qcbin/rest/domains/[DOMAIN]/projects/[PROJECT NAME]/tests

This returns all the data related to everything in the Test Lab of the project in an XML structure, including attachments, scenarios and scripts. However, as far as I can tell through manually sifting through the XML data, only the script entities include this field:
<Field Name="protocol-type"><Value>

That value appears to show the protocol used in the script. By counting the number of instances of that field in the 'Test' XML response I can successful count the total number of scripts in the project.

It would be nice if the API had something more built in to grab this, but this method will suffice for what I am building. Again, If anyone has a more efficient way of pulling this info or sees a flaw in using this I would love to hear it. Thanks!

0 Likes
Highlighted
Absent Member.
Absent Member.

Further analysis of the XML data set that gets returned from requesting 'tests' from the API has revealed an even better method to do this. Each entry has the tag:

<Field Name="subtype-id"><Value>

I have found these values based on what is the 'Test Plan'

    PERFORMANCE-TEST : test scenario

    DB-TEST : vugen test script

Why 'DB-TEST' is used to define a test script is beyond me, but I've gone through several projects in PC and confirmed this number is lining up correctly to the number of scripts in each project. So, by counting the number of of 'subtype-id' values with 'DB-TEST' I can now grab the total number of scripts and with the other value the total number of scenarios in any given project.

 

 

 

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.