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();


0 Avis

Laisser une réponse

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *