It's all about the answers!

Ask a question

How to attach external execution result files in RQM result log?


sanam chugh (122) | asked Jul 12 '12, 2:47 a.m.
retagged Jul 13 '12, 4:56 a.m. by Arne Bister (2.6k12832)
 Hi,

     I am able to execute my Test Cases successfully using CLA and want the result files that my framework is generating to be attached in RQM results. 

I have read the article https://jazz.net/library/article/809/#AttachFiles but I am not clear how to access the Java Properties file using the qm_AttchmentsFile variavle and update it .

Please provide suggestions.

Thanks,
Sanam

6 answers



permanent link
Thomas Neal (141133) | answered Jul 16 '12, 8:18 a.m.
JAZZ DEVELOPER
The exact answer will depend on whether your Command Line testscript is invoking an executable, a Windows .bat script or a Unix/Linux shell script.  Assuming you are invoking a Windows .bat script you would need to add something like the following to your .bat script.

echo myReport1=C:/tmp/report1.html  >>  "%qm_AttachmentsFile%"
echo myReport2=C:/tmp/report2.html  >>  "%qm_AttachmentsFile%"
...
echo myReportN=C:/tmp/reportN.html  >>  "%qm_AttachmentsFile%"

Note that I'm using forward slashes in the path pointing to the report file even on Windows platform.  Since that value is going into a java properties file we either need to use forward slashes or escape any usage of backslashes.  Also note the quotes around the evaluation of qm_AttachementsFile in case the path has any spaces in it (which it often does for temporary files).

If you are not invoking a .bat script, and still need some help, please let me know.


Comments
Pramod Chandoria commented Jul 16 '12, 12:50 p.m.
JAZZ DEVELOPER

Thanks Tom for chiming in


sanam chugh commented Jul 17 '12, 12:40 a.m.

Thanks Tom for such a detailed response. I am using Windows bat script. I followed the steps you mentioned. After execution, the RQM result has a "QMAdapter44108.err" file attached. This error file contains the msg "The system cannot find the path specified."

I am not sure what I am doing wrong. Please find by batch script

E:\RQM\MyScript.exe echo myReport1=C:\Logs\InfoLog.html >> "%qm_AttachmentsFile%" EXIT 0


sanam chugh commented Jul 17 '12, 12:56 a.m.

One question... Support for attaching external file is present in RQM 4.0... Is is also supported in RQM 3.0???

As per work item https://jazz.net/jazz02/web/projects/Rational%20Quality%20Manager#action=com.ibm.team.workitem.viewWorkItem&id=21416 , it is supported in RQM 4.0.

I am using RQM 3.0.Please confirm.

Thanks, Sanam


Thomas Neal commented Jul 17 '12, 9:23 a.m.
JAZZ DEVELOPER

Hello Sanam. In answer to your first question, you need to use forward slashes in the pathname to your report file, ie. echo myReport1=c:/Logs/InfoLog.html >> "%qm_AttachmentsFile%". Regarding your second question, this support is only available in RQM 4.0 and later.


Preeti Patil commented Feb 25 '13, 7:39 a.m. | edited Feb 25 '13, 7:48 a.m.
Hi, I am facing similar problem on Windows XP, where I need to set URL of automation report to RQM execution result. The report URL is read from a file and stored in a variable. This is what I am doing,

FOR /f "delims=" %%a in (%logdir%\LAReportLink.txt)  do set reportLink=%%a
echo AutomationReport="%reportLink%"  >>  "%qm_AttachmentsFile%" 

And, this is what I see on the .out file on Execution Result 
AutomationReport="http://xx.ibm.com/ResultsSummary.html  >>  "C:\Documents and Settings\Administrator\Local Settings\Temp\QMAdapter1410188893623044333.attach" 

Please suggest what should be the correct syntax to attach URL from a variable value to %qm_AttachmentsFile%.

Thanks,
Preeti

Thomas Neal commented Feb 25 '13, 9:44 a.m.
JAZZ DEVELOPER

Hi Preeti, if you are seeing this

AutomationReport="http://xx.ibm.com/ResultsSummary.html  >>  "C:\Documents and Settings\Administrator\Local Settings\Temp\QMAdapter1410188893623044333.attach"

on the stdout (.out file) then the redirection is somehow being escaped.  The variable name and  it's value should be going into the file associated with the value of %qm_AttachementsFile%.  I noticed in your post there is a missing double-quote after the variable value (ie. AutomationReport="http://xx.ibm.com/ResultsSummary.html).  Is this because you mistyped what you see in the .out file or is it really missing there?  If it's really missing, you could try removing the double-quotes around %reportLink% in your .bat script to see if that makes any difference.


Preeti Patil commented Feb 26 '13, 12:50 p.m.

 Hi Thomas, I tried without quotes still getting same line without quotes with replace value of  %reportLink%. 


AutomationReport=http://xx.ibm.com/ResultsSummary.html  >>  "C:\Documents and Settings\Administrator\Local Settings\Temp\QMAdapter1410188893623044333.attach" 

Thanks,
Preeti


Thomas Neal commented Feb 27 '13, 9:25 a.m.
JAZZ DEVELOPER

Preeti, that command looks correct.  If you are seeing that in the stdout file attached to the execution result then somehow the redirection (ie. >>) is being escaped.  If the line "AutomationReport=http://xx.ibm.com/ResultsSummary.html" gets placed in
C:\Documents and Settings\Administrator\Local Settings\Temp\QMAdapter1410188893623044333.attach, then your file will be attached to the execution result.

showing 5 of 8 show 3 more comments

permanent link
Pramod Chandoria (2.1k11220) | answered Jul 14 '12, 11:26 a.m.
JAZZ DEVELOPER
Hi @sanamchugh,
You need to get the full path of the file. For that you should try to get value of Environment variable "com.ibm.rqm.adapter.resultAttachmentsFile". Then you can open this file and provide details about the attachment.

Let me know if this does solve your problem.
-|- Pramod Chandoria

permanent link
sanam chugh (122) | answered Jul 16 '12, 1:32 a.m.
Hi  Pramod,

                  Thanks for your response. What I cant understand is how to get the value of the environment variable qm_attachmentsfile(this environment variable has the value of the java properties file) and how to update this file with the name and value pair?

Thanks,
Sanam

permanent link
Leandro David (721719) | answered Jun 10 '13, 4:02 p.m.
Hi, Does that apply for RFT Scripts too ?

I want to add custom attachment files to the result after my RFT is executed from RQM.

I made some tests and it seems that the variable qm_AttachmentsFile is not available during the execution of the RFT script. I'm trying to retrieve it using the same I retrieve other Execution Variables passed to the script.

Comments
Thomas Neal commented Jun 10 '13, 4:33 p.m.
JAZZ DEVELOPER

Currently I don't believe the RFT adapter supports this.  The RQM adapter library does contain the required infrastructure, but the RFT adapter would have to be modified to make use of it.  You could open an enhancement request for such support in a future release of the RFT adapter.  One other thing to note, qm_AttachmentsFile is an environment variable, not an execution variable.  RFT may implement something similar to what the command line adapter does using Execution Variables.  You might suggest this in the enhancement request.


Leandro David commented Jun 10 '13, 4:43 p.m.

Thanks Thomas
I just created the RFE at Developer Works

http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=35863

I think that is the right place to created the request right ?


permanent link
Bruno Fazoli (856) | answered Jan 14 '15, 5:10 p.m.
Hi all

!!PROBLEM SOLVED!!

I've spent many hours looking at some posts about this issue but no answer at all.
So I was trying to change the sintax on the .bat file and I realized how it works. Check the example below to attach links and files:

ECHO IBMSite=http://www.ibm.com >> %qm_AttachmentsFile%
ECHO GoogleSite=http://www.google.com >> %qm_AttachmentsFile%
ECHO RXLog=C:\\TEMP\\automacao.rtf >> %qm_AttachmentsFile%

I still have some doubts:
  1. How can I upload files when I running a .exe file instead of a .bat file?
  2. How can I indicate the file name dynamically since the file name of the execution log is a random and contains date and time?

Please Help!

permanent link
Maria Amalan (784164) | answered Apr 25 '18, 6:02 a.m.

 If someone can help me with my query, it will be really appreciated..

Whatever has been discussed above worked great for me in a framework that just uses Selenium and Java. But the same line is not working for me in another framework that uses Maven. Is there some change that is required in maven?

Code from my bat file::
mvn test -DsuiteXmlFile=%1
ECHO ExecutionReport=C:/.../Report/RQM-Test-Report.html >> "%qm_AttachmentsFile%"

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.