Automating Qt applications packaged as type-1 AppImages

Skip to end of metadata
Go to start of metadata

Table Of Contents

Synopsis

Qt applications packaged as type-1 (or type-2) AppImages can generally be automated with Squish for Qt.

Usually this only requires to choose a Squish for Qt package for the same Qt version as used by the Qt application, and enabling "Hook into sub-processes launched by the application" in the test suite settings (click on the wrench icon in Test Suites view, select the "AUT" tab at the bottom of the test suite settings editor/view).

However, it may be that the application's AppImage is started through a shell script which overwrites LD_PRELOAD or LD_LIBRARY_PATH, for example (for example stored as "./usr/bin/myapplication.sh" in the AppImage):

If so this will cause hookup failure in Squish, and the "Runner/Server Log" view will contain an error message similar to this:

[...] AUT stderr: ERROR: ld.so: object 'libsquishqtpre.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

This article shows how to solve this by extracting the application from the type-1 AppImage and modifying the shell script.

Step 1 - Check if it is a type-1 AppImage

When executing the following in a shell a type-1 AppImage will start the application and not output any help or usage information:

If it is a type-1 AppImage proceed with the following steps.

Step 2 - Enable sub-process hooking

At test suite settings (open via click on wrench icon in the "Test Suites" view) select the "AUT" tab (at the bottom of the test suite settings editor/view) check "Hook into sub-processes launched by the application".

Step 3 - Copy the type-1 AppImage contents to a new folder

In a shell execute the following (adjust paths and file names as required):

Step 4 - Modify the shell script

Modify the shell script that starts the application (for example "./usr/bin/myapplication.sh" inside $HOME/myapplication) to append to LD_LIBRARY_PATH:

Step 5 - Register the AUT

Register the AUT binary as "Application" in the "AUT" tab of the test suite settings ($HOME/myapplication/AppRun for this example).

At this point record and replay on the application should work. If this is not the case take a look at the "Runner/Server Log" view to check if there are any obvious problems reported. If you cannot resolve it, please contact Squish technical support, and please provide the newly collected support information (Help > Collect Support Information...) as this point, as well as the modified shell script file.

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