Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

 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

0 votes



6 answers

Permanent link
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.

1 vote

Comments

Thanks Tom for chiming in

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

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

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.

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

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.

 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

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
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

0 votes


Permanent link
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

0 votes


Permanent link
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.

0 votes

Comments

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.

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
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!

0 votes


Permanent link

 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%"

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,020

Question asked: Jul 12 '12, 2:47 a.m.

Question was seen: 10,729 times

Last updated: Apr 25 '18, 6:02 a.m.

Confirmation Cancel Confirm