It's all about the answers!

Ask a question

How to Update Test Script Sections contents via the RQM Reportable REST API?

Victor Polo de Gyves Montero (1316) | asked Feb 26 '19, 9:32 a.m.
edited Feb 26 '19, 10:02 a.m.

(Please note: This same method updates correctly Test Plan and Test Case Sections: only fails to update Test Script Sections).

Which are the missing steps or instructions to update a Test Script Section, created by a Test Artifact Template for a Configurations-Enabled RQM project at CLM 6.0.6?

Given the following test script in RQM, we have created it using a custom test artifact template which adds two sections: “RichTextSection” and “GridSection”.

RichTextSection” section should contain free-form rich text data. “GridSection” section should contain a grid with two columns of data.

So, I created the next code to get the XML of the test scripts and its ETag. I must remind that this same method correctly updates test plan sections and test cases sections but not test script sections:

// Get XML of test script
RqmApiClient customClient = new RqmApiClient(jtsUri, username, password);
HttpClient httpClient = customClient.getHttpClient();
String uri = "" + "/executionscript/"
HttpGet httpUriRequest = new HttpGet( uri + "?oslc_config.context="+conf3 + "&abbreviate=false" )
HttpResponse response = httpClient.execute( httpUriRequest );
HttpEntity entity = response.getEntity();
String result = EntityUtils.toString(entity);
writeStringToFile(result, "out/getTestScriptResourceFromRqmApi.xml");
String ETag = response.getHeaders( "ETag" )[0].getValue();

Then, I change the file at out/getTestScriptResourceFromRqmApi.xml to update the test script’s title, description and the values at the sections “RichTextSection” and “GridSection” using the following code:

// Update test script
HttpPut httpPut = new HttpPut( uri + "?oslc_config.context="+conf3 );
File file = new File("out/getTestScriptResourceFromRqmApi.xml");
String resourceFromFile = new String (Files.readAllBytes(file.toPath()),Charset.forName("UTF-8"))
httpPut.setEntity(new StringEntity( resourceFromFile ));
httpPut.addHeader("ETag", ETag);
httpPut.addHeader("If-Match", ETag);
HttpResponse response = httpClient.execute( httpPut );

After that, the RQM application answers, as expected:

HTTP/1.1 200 OK

BUT only the title, the description and the test script steps of the test script are updated! No updates of the custom test section are honored by the RQM API: Cells marked with red circles should show A5 and B5 labels, instead of A1 and B1, so that data was NOT UPDATED. But, title and description, marked with green circles are correctly updated.

Interestingly, Manual test script steps were correctly updated:

The data of RichTextSection was not updated: Data on red circle should say: “Some additional info update 5”. But again, no update for both sections.

So, what is wrong/what additional steps or information should be done to update sections for a test script created using a custom template? Could you provide an example?

As additional information, I include the XML to PUT, with the data updated.

XML used to PUT (update) the test script:

<?xml version="1.0" encoding="UTF-8"?>
<ns2:executionscript xmlns:ns2="" xmlns:ns1="" xmlns:ns3="" xmlns:ns4="" xmlns:ns5="" xmlns:ns6="" xmlns:ns7="" xmlns:ns8="" xmlns:ns9="" xmlns:ns10="" xmlns:ns11="" xmlns:ns12="" xmlns:ns13="" xmlns:ns14="" xmlns:ns15="" xmlns:ns16="" xmlns:ns17="" xmlns:ns18="" xmlns:ns20="" xmlns:ns21="">  <ns2:projectArea href="" alias="YYY+YYY+YYY+Development+%28Quality+Management%29"/>
 <ns3:title>DemoTestScript1 update5</ns3:title>
 <ns3:description>Demo description update5</ns3:description>
 <ns5:state ns7:resource=""></ns5:state>
 <ns3:creator ns7:resource="">vdegyves</ns3:creator>
   <ns2:step stepIndex="1" ns6:type="execution" ns7:about="">
     <ns3:title>Some content to create the test script update5¬†(description)</ns3:title>
       <div xmlns="">
         <div dir="ltr">
           <p dir="ltr">Some content to create the test script update5¬†(description)</p>
   <ns2:step stepIndex="2" ns6:type="execution" ns7:about="">
     <ns3:title>Some additional (second) step update5¬†(description)</ns3:title>
       <div xmlns="">
         <div dir="ltr">Some additional (second) step update5¬†(description)</div>
 <ns2:component href=""/>
 <ns2:template href=""/>
 < xmlns="" extensionDisplayName="RichTextSection">
   <div xmlns="">Some additional info update 5</div>
 < xmlns="" extensionDisplayName="GridSection" type="GRID">{"columnNames":["Column 1","Column 2"],"value":[[["A5"],["B5"]]]}</>

One answer

permanent link
Paul Slauenwhite (8.4k12) | answered Feb 27 '19, 6:26 a.m.

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.