QF-Test allows me to take a screenshot of the whole desktop with:
from imagewrapper import ImageWrapper
iw = ImageWrapper(rc)
screenshot = iw.grabScreenshot()
How can I take a screenshot of only the browser?
QF-Test allows me to take a screenshot of the whole desktop with:
from imagewrapper import ImageWrapper
iw = ImageWrapper(rc)
screenshot = iw.grabScreenshot()
How can I take a screenshot of only the browser?
For the sake of completeness:
If you are testing a Java application you can also use the grabImage
function. This function works even when the component is hidden by another window. Unfortunately (until now), grabImage
doesn't work for Web.
from imagewrapper import ImageWrapper
iw = ImageWrapper(rc)
image = iw.grabImage(rc.getComponent("myComponentId")) # this methods also has some optional/additional parameters. In the qftest script editor, type iw. and then press Ctrl+Space to see the full "documentation".
rc.logImage(image)
When using the script from Aaron Digulla, keep in mind, that the SUT window has to be in the foreground/visible on the screen. There are some options to ensure this [for example: "Raise SUT windows automatically" + event] (See: http://www.qfs.de/qftest/manual/en/opt_play.html). Keep in mind, that you can also change these options during runtime (See: http://www.qfs.de/qftest/manual/en/user_scripting.html#usec_scripting_options).
Use the DomNode API to get the geometry of a node in the DOM. You can use those to specify which are should be included in the screenshot: