FEST

Error in ScreenshotOnFailureListener.takeScreenshotAndReturnFileName

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: FEST-Swing 1.2rc
  • Fix Version/s: FEST-Swing 1.2
  • Component/s: Swing
  • Labels:
    None
  • Environment:
    Windows 2K,
  • Number of attachments :
    0

Description

I was hitting getting an error from the ScreenshotOnFailureListener
and it seems to be due to a typo in the code. I made the change below
(adding () after 'output' to call the method instead of getting a
string-ified object) and now I'm getting the screenshot as expected
(well, i have dual monitors and it's only grabbing one of the them,
but that's a different issue)

private String takeScreenshotAndReturnFileName(ITestResult result) {
    String imageName = screenshotFileNameFrom(result);
//    String imagePath = concat(output, separator, imageName); //old code
    String imagePath = concat(output(), separator, imageName); //my
    try {
      output.createIfNecessary();
      screenshotTaker.saveDesktopAsPng(imagePath);
    } catch (Exception e) {
      logger.log(SEVERE, e.getMessage(), e);
      return null;
    }
    return imageName;
  }

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: