I was trying to get your manual example to work (example
30.2 in the English version), and was able to solve
my problem under Windows XP as follows:
from imagewrapper import ImageWrapper
#create ImageWrapper instance
iw = ImageWrapper(rc)
#take screenshot of the whole screen
currentScreenshot = iw.grabScreenshot()
#save screenshot to a file
Two things to notice:
Forward slash in path name, and
Location of the path within my QF-Test installation
I could not place the path outside of the QF-Test
installation directory, even after setting properties to be not read-only.
I did not examine the issue any further (to find the real
cause(s) of the problem), and confess I am no Windows expert.
It then occurred to me how convenient it might be to have a
screenshot node that one could insert within test cases that are run in batch
mode, since the run log of qftest provides a very nice format. Placing an
intentional rc.logError in a server script is not a viable solution, as it throws
an exception that is caught by the Cleanup node.
Or maybe a logMessage with an additional parameter for a
screenshot might be a possibility?
MATRIXWARE Information Services GmbH
11/8, 1060 Vienna, Austria, Europe
+43 (1) 585 73 61 – 6056