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
6 answers
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.
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
showing 5 of 8
show 3 more comments
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
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
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.
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
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:
Please Help!
!!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:
- How can I upload files when I running a .exe file instead of a .bat file?
- 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!
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%"