saveDesktopScreenshot

saveDesktopScreenshot(filename)

This function grabs an image of the screen the AUT is running on and stores it on the computer where the squishide (or squishrunner) is executing.

If no path is specified the file gets stored in the working directory of the squishrunner process. (The default working directory of squishrunner is the path of the test case that it is currently executing.)

If a relative path is specified it is relative to the working directory of the squishrunner process. (The default working directory of squishrunner is the path of the test case that it is currently executing.)

If an absolute path is specified that path is used as is.

The filename should have a suffix denoting the image format to be used. Here's an example of use that is legal in JavaScript, Python, Ruby, and Perl:

saveDesktopScreenshot("screen.png");

And for Tcl:

saveDesktopScreenshot "screen.png"

The available formats vary, but will always include at least the following:

  • .bmp — Windows Bitmap
  • .png — Portable Network Graphics
  • .ppm — Portable Pixmap
  • .xbm — X11 Bitmap (monochrome)
  • .xpm — X11 Pixmap

This API is a shorthand for calling grabDesktopScreenshot() followed by a call to Image.save(fileName) on the resulting image.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.
The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.

Search Results