It's all about the answers!

Ask a question

Not adding screenshot in execution results-RQM Junit Selenium Adapter


shyam Gorantala (611) | asked May 28 '14, 5:39 a.m.
We are using  RQM  with RQMJunitSelenium adapter configured on remote machine and  trying to add the screenshot captured by Junit selenium code to the test execution results in RQM , But Screenshot is not saved in temp directory and also not attached to execution results,below is the code snippet used.

 

We are running the test as per the guidelines mentioned in this link:

http://www.ibm.com/developerworks/rational/library/run-automated-selenium-junit-tests/

http://pic.dhe.ibm.com/infocenter/clmhelp/v4r0/index.jsp?topic=%2Fcom.ibm.rational.test.qm.doc%2Ftopics%2Ft_configselenadp.html

 

public void takeScreenShot(String fname) throws Exception   

          File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);

          String imageFileDir = System.getProperty("selenium.screenshot.dir");

          if (imageFileDir == null)

            imageFileDir = System.getProperty("java.io.tmpdir");

          FileUtils.copyFile(scrFile, new File(imageFileDir, fname));

      }

Run-time value of the property ”selenium.screenshot.dir” = C:\Users\Administrator\AppData\Local\Temp\2\QMAdapterJUnitImgs_1400829590655


RQM Version:  4.0.5

RQMJunitSeleniumAdapter  version: 4.0.5 



One answer



permanent link
Vaibhav Srivastava (2861) | answered May 29 '14, 4:15 a.m.
JAZZ DEVELOPER
As the snapshot is not getting saved in the temp dir, this seems like more specific to the Selenium script which you have here and not specific to the RQM Selenium adapter
Some quick searches on internet gave me a hit which may be helpful
http://blogs.steeplesoft.com/posts/2012/01/24/grabbing-screenshots-of-failed-selenium-tests/
Thanks
Vaibhav

Your answer


Register or to post your answer.