Hooking arbitrary Windows applications

Skip to end of metadata
Go to start of metadata

Table of Contents

Synopsis

It is possible to hook arbitrary Windows applications when running Squish on Windows. In this case "arbitrary" means that the applications don't have to be instrumented by hand, and they don't need to be child applications of already hooked processes either.

Approach #1 - Hook up explicitly via window title

Approach #2 - Automatically hook up via window title

This works by editing the configuration file which is read by the code in Squish which handles interactions with native Windows controls (the fallback wrapper as it's called — it kicks in when the particular toolkit wrapper, e.g. Qt, doesn't know what to do with some control).

Open the file "<SQUISH_DIR>/etc/winwrapper.ini" and modify the entry Extra Windows to contain the window title of the respective, other application. For example:

winwrapper.ini

Now you can record tests on applications that use Qt, Java, or some other toolkit, and whenever Squish notices a window that has a caption which matches one of those listed in the Extra Windows setting, it will hook into the window's process so that you can record actions on it (and create verification points, etc).

The Extra Windows setting is a comma-separated list of strings, each being the caption of a window to hook into. Each window caption must be enclosed in double quotes.

You don't need to specify the exact caption
The Extra Windows setting understands the * wildcard. This is handy for cases where a window caption can vary (for example, most web browsers and PDF viewers show the page/document name in their caption). For example, instead of...

...which will only work if Acrobat Reader has a particular file open, we can use...

...which will work with Acrobat Reader no matter what document it has open.

Related Information:

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.