Squish can be configured to create screenshots on fails and errors. This can often be useful for analyzing why (for example) an object could not be found.
For example in Python:
Please note that this screenshot functionality is designed so that the screenshot will be taken by code that has been injected into the application (in most Squish editions). This means that if the application has quit (unexpectedly or not) taking a screenshot will not work, and result in this error in the test results/report:
RuntimeError: Screenshot taken from the desktop is invalid
So if you get this error it might be that your application has quit/crashed, probably unexpectedly.