IBM Support

About exporting test scripts to CSV for a test case/all test cases in a Rational Quality Manager (RQM) project area

How To


Summary

Rational Quality Manager (RQM) allows the export of test scripts from a list view (Construction > Browse > Test Scripts) to CSV but that only includes data available in the columns displayed in that view. That data does not include manual test script steps. There is no way in the RQM web UI to export a single manual test script and its steps. The RQM Reportable REST API can be used to retrieve script steps in XML which can be converted later to CSV. Report Builder with Lifecycle Query Engine (LQE) can return test script steps and its results can be exported to CSV. Additionally, Rational Publishing Engine (RPE) can be used as well but that is not covered here.

Objective

The objective is to get manual test scripts in an RQM project area with script steps to CSV

Environment

REST API method can be used in any supported version of RQM. The LQE method requires 6.0.x

Steps

Using the RQM REST API

The RQM REST API can be used to retrieve test script data in XML and the XML can be converted to CSV. An application/script can read the XML resource and generate a CSV file.
The following can be used as a starting point in the process:

NOTE: The XML to CSV conversion is beyond the scope of an IBM support case.

  • Download a REST Client for your browser. A web search for REST Client should return a few choices such as RESTClient for Firefox and Restlet for Chrome. Another option is to download the RQM URL Utility from the All Downloads section of any RQM version on jazz.net
  • The test script feed can be used to download up to 512 test scripts per page of XML with an HTTP GET using the REST Client. The number of test scripts per page of XML is dependent on the value of the  Max Feed Entries/Page parameter in RQM Administration > Advanced Properties >  RQM Integration Component. The default value is 50. 
  • The test script feed URL documented here https://jazz.net/wiki/bin/view/Main/RqmApi#feedUrl_for_interaction_with_a_f will be used with the abbreviate parameter documented here https://jazz.net/wiki/bin/view/Main/RqmApi#abbreviate to ensure that the test script steps are include in the feed.

  • Below is an example test script feed using abbreviate=false to return test scripts steps in the XML.  Server, port and context root are part of the RQM public URI. "RQMProject" is the RQM Project area alias which can be found in the project feed.

test script feed URL:

https://<server>:<port>/<context root>/service/com.ibm.rqm.integration.service.IIntegrationService/resources/RQMProject/testscript/?abbreviate=false

project feed URL to get project alias:

https://<server>:<port>/<context root>/service/com.ibm.rqm.integration.service.IIntegrationService/projects

  • The REST client is now used for an HTTP GET on the test script feed URL. The REST client should provide a way to add a custom HTTP Header and this is required before the GET is preformed. The header name "accept" with value "txt/xml" should be be added first. Here is an example in a Firefox REST client
accept header
GET
  •  The REST client will look similar to the screen shots above with an option to GET for the HTTP method and a button to send the test script feed
  • The XML returned from the GET on the test script feed with abbreviate=false will include the description and expected result for each step. This snippet shows 2 steps and their description/expected result:
<ns2:steps><ns8:step stepIndex="1" type="execution" ns3:id="_z9U0QlfuEemkU6N7kveJvg"><ns8:name>step1 description</ns8:name><ns8:title>step1 description</ns8:title><ns8:description><div xmlns="http://www.w3.org/1999/xhtml">step1 description</div></ns8:description><ns8:expectedResult><div xmlns="http://www.w3.org/1999/xhtml">step1 expected result</div></ns8:expectedResult><ns8:comment/><ns8:compare/></ns8:step><ns8:step stepIndex="2" type="execution" ns3:id="_c9Gfc2HqEemBQZ86fPpmtA"><ns8:name>step2 description</ns8:name><ns8:title>step2 description</ns8:title><ns8:description><div xmlns="http://www.w3.org/1999/xhtml">step2 description</div></ns8:description><ns8:expectedResult><div xmlns="http://www.w3.org/1999/xhtml">step2 expected result</div></ns8:expectedResult><ns8:comment/><ns8:compare/></ns8:step></ns2:steps>
  •  If the feed requires multiple pages of XML those pages will be listed at the top of the feed like this:
https://host:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/myproject/testscript?token=_xJD7MGLWEemBQZ86fPpmtA&amp;page=0"/><link rel="next" href="https://host:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/myproject/testscript?token=_xJD7MGLWEemBQZ86fPpmtA&amp;page=1"/><link rel="last" href="https://host:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/myproject/testscript?token=_xJD7MGLWEemBQZ86fPpmtA&amp;page=2"
  • The larger the Max Feed Entries/Page noted above the few pages will have to be retrieved to get all test scripts 
  • Finally the XML can be parsed and converted to CSV with a code that is not provided by IBM customer support. 

Using Report Builder with Lifecyle Query Engine

The Jazz Report Service (JRS) with Report Builder and Lifecyle Query (LQE) engine as the data source provides another simple way to get test script steps for a large number of manual test scripts. LQE is required as the data source because not all manual test script steps are stored in the data warehouse, only steps linked to a defect or requirement. Below is basic example report that can be exported to Microsoft Excel format. 

  •  From Report Builder "Choose a Report Type" select  Lifecycle Query Engine if the project is not enable for configuration management or Lifecyle Query Engine scoped by a configuration if the project(s) is enabled for configuration management 
  •  When selecting the artifact type use QM Test Script

  •  Here is the trace relationship for this basic example report:
step trace relationship
  • Here is the report output showing the test script ID and each step:
report output
  •  Select the Export drop-down menu and export to Micrsoft Excel format 

Document Location

Worldwide

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSUVV6","label":"IBM Engineering Test Management"},"Component":"","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"All support Rational Quality Manager versions","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Quality Manager

Document Information

Modified date:
23 April 2019

UID

ibm10880117