Using Image-based lookups without running an AUT

Using Image-based lookups without running an AUT

Using Image-based lookups without running an AUT

The following article is prepared for the Qt toolkit, however, a similar approach can be applied to other toolkits supported by Squish.

Introducing Image-based lookups in Squish 6.3 allowed users to interact not only with complex graphical objects in the Application Under Test (AUT), but with other elements displayed on screen. We can imagine a situation where a user wants to interact with them while the AUT is not running (i.e., to do some pre-configuration on a test environment).

However, Squish must be attached to a GUI application before record and replay of Image-based lookups work. To make this possible, we recommend launching a simple Qt application in the background.

For this purpose, the user can utilize one of the example applications distributed with every Squish package, e.g., the addressbook application. This application can be launched from tests whenever the user wants to use Image-based lookups while the proper AUT is not running. After Squish attaches to the addressbook application, it can be minimized with ToplevelWindow Object helper.

win = ToplevelWindow.focused()

After that, it is possible to record and replay Image-based actions.

An alternative solution is to create a simple dummy application that runs an endless event-loop. It does not have to be an application with a visible GUI. The following code snippet can be used to create such an application:

#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
    QApplication a(argc, argv);
    MainWindow w;
    return a.exec();
Jakub has worked in Quality Assurance since 2012. Over the years he has gained experience in manual, automatic and performance testing. A Python enthusiast, Jakub joined froglogic in 2016 to support Squish users, conducting trainings and offering consulting.

0 Kommentare

Eine Antwort hinterlassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.