How to add new attachments, as log files to the test case execution result using RQM JUnitSelenium Adapter
Hi,
I am trying to upload a log file to RQM test case execution record, during my automation process.
I am using RQM JUnitSelenium Adapter to make the Appium integration with Rational Quality Manager. I already got to attach all screenshots using the path content in this variable System.getProperty("selenium.screenshot.dir").
We trying to figure out how to work through those links below, but without success:
https://www.ibm.com/support/knowledgecenter/SSYMRC_5.0.2/com.ibm.rational.test.qm.doc/topics/t_add_cmd_line_attachments.html
https://jazz.net/forum/questions/81549/how-to-attach-external-execution-result-files-in-rqm-result-log
Which or Where I have to edit to set the Log file path?
Thanks for the help.
Malliens
5 answers
@Subhajit Bhuiya or @Abhishek Gour,
I have talked with @Ricardo Souza about this issue. It seems they do understand the instructions from the links provided about how to add attachments to the execution result, however, they would like to obtain a more explicit answer:
The problem they have is this:
System.getProperty("com.ibm.rqm.adapter.resultAttachmentsFile") - They got the path value, they don't know if have a file inside, in a case that they check and there is file, they have to update that file?
System.getProperty("qm_AttachmentsFile") - This they couldn't got any value
So, they would like to make sure they have the right environment variable that actually points to the right temporary file. Is there a way for them to actually verify this in the machine where the script is going to be executed?
<style type="text/css">
body { margin: 0 0 0 0; padding:0 0 0 0 } td,div { font-family:Arial;font-size:8pt;vertical-align:top } / Copyright IBM Corp. 2016 All Rights Reserved. / body { margin: 0 0 0 0; padding:0 0 0 0; overflow:hidden; background-color:#fafafa; } .grayBackground { background-color:#f6f6f6; } .transcript { background-color:#d2d2d2;} .messageBlock {padding-left:10px; padding-right:10px;padding-top:0} .expansion{height:10px;width:100%;overflow:hidden;} .expansionx{height:10px;overflow:hidden;} .line{height:1px;background-color:#cccccc;overflow:hidden;} .message { padding-left:0px; padding-right:65px;margin-left:0px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre; white-space:pre-wrap; } .messageCont { padding-left:0px; margin-left:95px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre;white-space:pre-wrap;} .other { font-size:11px;color:#1970b0;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; white-space:nowrap; padding-top:2px; } .myself { font-size:11px;color:#222222;font-style:normal;font-weight:bold;font-style:normal;float:left; width:95px; white-space:nowrap; padding-top:2px; } .otherCont { font-size:8px;text-align:right; color:#1970b0;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .myselfCont { font-size:8px;text-align:right; color:#222222;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .system { font-size:11px; word-wrap:break-word;color:#d13f08;font-style:normal;font-weight:normal; white-space:-moz-pre-wrap; _white-space:pre;white-space:pre-wrap; } .showTimestamp { padding-left:20px;font-size:11px; float:right; color:#999999;font-style:normal;font-weight:normal; } .other1 { font-size:11px; color:#ba006e;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; padding-top:2px; } .otherCont1 { font-size:8px;text-align:right; color:#ba006e;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other2 { font-size:11px; color:#007670;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; padding-top:2px; } .otherCont2 { font-size:8px;text-align:right; color:#007670;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other3 { font-size:11px; color:#3b0256;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; padding-top:2px; } .otherCont3 { font-size:8px;text-align:right; color:#3b0256;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other4 { font-size:11px; color:#00512b;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; padding-top:2px; } .otherCont4 { font-size:8px;text-align:right; color:#00512b;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other5 { font-size:11px; color:#a91024;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; padding-top:2px;} .otherCont5 { font-size:8px;text-align:right; color:#a91024;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other6 { font-size:11px; color:#b8471b;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; padding-top:2px;} .otherCont6 { font-size:8px;text-align:right; color:#b8471b;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .other7 { font-size:11px; color:#7f1c7d;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; padding-top:2px;} .otherCont7 { font-size:8px;text-align:right; color:#7f1c7d;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; } .highlight { background-color:#bed6f8; } .datestamp { padding-right:0px; font-size:11px; cursor:default;padding-top:1px;padding-bottom:1px; background-color:#a7a7a7; width:100%; float:left; text-align:right; color:#333333; font-weight:bold; font-style:italic; } #chatAlert { float:left; border-bottom:1px solid #E8D091; padding:6px; width:100%; color:#A5754C; } #chatAlertImage { float:left; } #chatAlertText { float:left; margin-left:6px; margin-right:10px;} #chatAlertClose { float:right; margin-right:10px; padding-right:6px; margin-top:0px; } #chatAlertText a { color:#A5754C; } #chatAlertText a:hover { color:#A5754C; text-decoration:none; } .tsDisplay { display:block }.dsDisplay { display:none }
</style>
|
|
|
|
|
2:15:12 PM |
Hi Ricardo,
String attachmentsPathFile = "c:\tmp\attachmentInfoFile.txt";
FileOutputStream fos = new FileOutputStream(attachmentsPathFile);
String filePath1 = "myFile1=c:\tmp\file1.txt";
fos.write(filePath1.getBytes("UTF-8"));
String linkPath1 = "myFile1=http://www.ibm.com";
fos.write(linkPath1.getBytes("UTF-8"));
fos.close();
This is run time updating of the attachment file info. When your execution would be over, the attachmentFileInfo would be read by the adapter and the attachments would be created for the result based on these key-value pairs present in attachmentInfoFile.
I hope these steps solves your problem. In case you need any other info, please respond to this chain.
Thanks,
Abhishek
Good Afternoon,
I follow the instructions, but it still not working. Maybe I had done something wrong.
Just to check here are the files:
Arquivolog.log - That's the file that I want to send attach to the RQM execution. content below
2017.03.28.09.00.36: Arquivo gerado com sucesso: C:\Temp\RQMJUnitSeleniumAdapter\Appium_test_results\2017.03.28\APJ_ANDROID\COMPLETA\XML\2017.03.28.09.00.36_evidencias.xml
2017.03.28.09.00.37: ---------------------------------------------
2017.03.28.09.00.37: teste: testCase_SobreVersaoApp - Iniciado
2017.03.28.09.00.37: Aqui vem o nome do metodo: testCase_SobreVersaoApp
2017.03.28.09.07.54: Arquivo gerado com sucesso: C:\Temp\RQMJUnitSeleniumAdapter\Appium_test_results\2017.03.28\APJ_ANDROID\COMPLETA\XML\2017.03.28.09.07.54_evidencias.xml
2017.03.28.09.07.54: ---------------------------------------------
2017.03.28.09.07.54: teste: testCase_SobreVersaoApp - Iniciado
2017.03.28.09.07.54: verificar: area nao logada - pagina de login
2017.03.28.09.07.54: clicar: botao-sobre
2017.03.28.09.08.02: status: objeto versao-app encontrado!
2017.03.28.09.08.05: Versão 3.2.2
2017.03.28.09.08.12: clicar: icone-bb
2017.03.28.09.08.13: Não existe nenhum erro registrado
2017.03.28.09.08.16: status: objeto mensagem-centralizador encontrado!
2017.03.28.09.08.19: clicar: botao-OK
2017.03.28.09.08.28: clicar: botao-voltar-app
2017.03.28.09.08.37: Arquivo gerado com sucesso: C:\Temp\RQMJUnitSeleniumAdapter\Appium_test_results\2017.03.28\APJ_ANDROID\COMPLETA\XML\2017.03.28.09.07.54_evidencias.xml
2017.03.28.09.08.37: teste: testCase_SobreVersaoApp finalizado com Sucesso
2017.03.28.09.08.37: ---------------------------------------------
attchmentInfoFile.txt - content below
myFile1=c:\Temp\arquivoLog.log
selenium.properties - file with adapter properties - content below, without the comments
com.ibm.rqm.selenium.seleniumClasspath=C:\Temp\MovAppiumTests.jar;C:\Temp\libs\appium\commons-lang-2.6.jar;C:\Temp\libs\appium\jcifs-1.3.3.jar;C:\Temp\libs\appium\commons-codec-1.10.jar;C:\Temp\libs\appium\commons-exec-1.3.jar;C:\Temp\libs\appium\commons-io-2.5.jar;C:\Temp\libs\appium\commons-lang3-3.4.jar;C:\Temp\libs\appium\commons-logging-1.2.jar;C:\Temp\libs\appium\gson-2.3.1.jar;C:\Temp\libs\appium\guava-19.0.jar;C:\Temp\libs\appium\hamcrest-core-1.3.jar;C:\Temp\libs\appium\hamcrest-library-1.3.jar;C:\Temp\libs\appium\htmlunit-driver-2.21.jar;C:\Temp\libs\appium\httpclient-4.5.2.jar;C:\Temp\libs\appium\httpcore-4.4.4.jar;C:\Temp\libs\appium\httpmime-4.5.2.jar;C:\Temp\libs\appium\java-client-3.4.1.jar;C:\Temp\libs\appium\jna-4.1.0.jar;C:\Temp\libs\appium\jna-platform-4.1.0.jar;C:\Temp\libs\appium\junit-4.12.jar;C:\Temp\libs\appium\selenium-api-2.53.1.jar;C:\Temp\libs\appium\selenium-java-2.53.1.jar;C:\Temp\libs\appium\selenium-leg-rc-2.53.1.jar;C:\Temp\libs\appium\selenium-remote-driver-2.53.1.jar;C:\Temp\libs\appium\selenium-support-2.53.1.jar;
com.ibm.rqm.commandline.systemproperties=false
com.ibm.rqm.commandline.executionproperties=CREATE
com.ibm.rqm.adapter.resultAttachmentsFile.maxfilesize=50
com.ibm.rqm.adapter.resultAttachmentsFile=C:\Temp\attachmentInfoFile.txt
Hi Ricardo Souza,