[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qftestJUI] Comparing Screenshots - Best Practices?
Hello Mark, i've found a solution in this list: "[qftestJUI] Comparing Screenshots - Best Practices?" Greg wrote: "Here's some example Jython code. Put it in an "SUT script" node and experiment a little. -------------------- # first get hold of your component com = rc.getComponent("some component id"); size = com.getSize() # create a buffered image from java.awt.image import BufferedImage bi = BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB) # tell the component to paint into the image buffer com.paint(bi.getGraphics()) # Now you've got the component snapshot in the buffered image and # can use whatever package you've got available to proceed. To save # the file as PNG image with PngEncoder, all you need to do is from java.io import FileOutputStream fos = FileOutputStream("some filename") fos.write(PngEncoderB(bi).pngEncode()) fos.close --------------------" > it works for me. The only thing ist, that the titlebar can't be recorded => thats my experiences. So any better idea, would be desired. Best regards, Robert