RQM 5.0.2 Getting execution result attachements through REST API
I am using REST API for accessing RQM Test Plan details.
Now I need is to get Execution results through REST API. I am able to fetch the details , however it has some screen shots / Images which I am not able to download through my code. It needs browser to download it . Execution result link which through which I would be able to download the attachements / Images through my code.
Now I need is to get Execution results through REST API. I am able to fetch the details , however it has some screen shots / Images which I am not able to download through my code. It needs browser to download it . Execution result link which through which I would be able to download the attachements / Images through my code.
3 answers
Hi Harshal,
Can you try using the href value of the attachment tag coming as part of ExecutionResult xml
Can you try using the href value of the attachment tag coming as part of ExecutionResult xml
Comments
I am using the same. the image which we get from it is corrupted or too big .
Below is the command I using
C:\Program Files\Internet Explorer>java.exe -jar C:\Users\IBM_ADMIN\Downloads\RQ
M-Extras-RQMUrlUtil-4.0.3\RQMUrlUtility.jar -command GET -user ckumar45@in.ibm.c
om -password 12345 -filepath C:\\testplan\\testplan.jpg -url "https://rtcclm2:94
43/qm/service/com.ibm.rqm.planning.service.internal.rest.IAttachmentRestService/
_g2unwUzPEeWXOuHUUui6Mw"
Below is the command I using
M-Extras-RQMUrlUtil-4.0.3\RQMUrlUtility.jar -command GET -user ckumar45@in.ibm.c
om -password 12345 -filepath C:\\testplan\\testplan.jpg -url "https://rtcclm2:94
43/qm/service/com.ibm.rqm.planning.service.internal.rest.IAttachmentRestService/
_g2unwUzPEeWXOuHUUui6Mw"
Comments
Harshal sent me the corrupted PNG file and I noticed that it was tagged with the UTF-8 BOM (the first six byes are EF BF BD 50 4E 47) while the first four bytes of a PNG file should be 89 50 4E 47. So it appears that the tool treats the stream as a string rather than binary. In fact, we can see the message "RQMUrlUtility: Calling [ HTTP GET ] method to retrieve XML from a specified URL" in the command output.
Strictly speaking, the IAttachmentRestService API is an internal API, not RQM Reportable REST API, so we can't expect it to work with any URLs.
Since the source code is included in the tool, we can build the tool with some minor changes so that it can work with the internal attachment URL.
1. Locate the file RQMUrlUtility\src\com\ibm\rqm\url\client\RQMUrlGET.java.
2. Locate this line - it works for the "attachment" resource when using RQM Reportable REST API
if (sAttachURL.indexOf("attachment") == -1) {
3. Change it as shown below - now it takes care of IAttachmentRestService API as well
if (sAttachURL.indexOf("attachment") == -1 && sAttachURL.indexOf("IAttachmentRestService") == -1) {
4. Rebuild the tool.
If the tool works correctly, we should see this message in the command output.
Strictly speaking, the IAttachmentRestService API is an internal API, not RQM Reportable REST API, so we can't expect it to work with any URLs.
Since the source code is included in the tool, we can build the tool with some minor changes so that it can work with the internal attachment URL.
1. Locate the file RQMUrlUtility\src\com\ibm\rqm\url\client\RQMUrlGET.java.
2. Locate this line - it works for the "attachment" resource when using RQM Reportable REST API
if (sAttachURL.indexOf("attachment") == -1) {
3. Change it as shown below - now it takes care of IAttachmentRestService API as well
if (sAttachURL.indexOf("attachment") == -1 && sAttachURL.indexOf("IAttachmentRestService") == -1) {
4. Rebuild the tool.
If the tool works correctly, we should see this message in the command output.
RQMUrlUtility: Calling [ HTTP GET ] method to download an attachment