Running RFT script through RQM not capturing screenshots to log Results

420 views Asked by At

When I run my RFT script through RQM all the screen shots are displayed as HTML code for example:

On the execution result I get the following message:

LogIngoBufferedImage@81d411c9: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 IntegerInterleavedRaster: width = 1280 height = 1024 #Bands = 3 xOff = 0 yOff = 0 dataOffset[0] 0

I'm using this code in my script

 BufferedImage HC = RationalTestScript.getRootTestObject().getScreenSnapshot(); 
        RationalTestScript.logInfo("LogIngo"+ HC);

and

logTestResult("Hair Color Failed" + HC, HairColorVP );

Is there a way to attached the screenshot to the Execution Results Details?

Im using RQM 4 and RFT 8.3 v2

1

There are 1 answers

0
DeZaelez On

My scripts use the native log statement to capture the screenshot. For example, if a test fails, I say:

logError("My test failed", getRootTestObject().getScreenSnapshot());

The same goes for if I want to log a warning or an info message.

logWarning("This is a warning", getRootTestObject().getScreenSnapshot());
logInfo("This is an info message", getRootTestObject().getScreenSnapshot());

However, when the test pases and I want to record a screenshot, I send it to a commonutils method that performs a logTestResult AND a logInfo which captures a screenshot.

public void logTestPass(string passMessage, String additionalInfo) {
   logTestResult(passMessage, true, additionalInfo);
   logInfo("Screenshot of PASS condition", getRootTestObject.getScreenSnapshot());
}

I don't know of any other way to get the screen if a test passes so I use a combination of both. If anyone else knows how to do this, feel free to add your comment.