Automating Qt applications started from non-Qt Windows applications

Last edited on

Overview

It is possible to record and replay on Qt applications which get started by Windows applications. (The Windows applications also get automated in this scenario.)

Please note that this requires licenses for Squish for Qt and Squish for Windows.

Prerequisites

Allowing Squish to hook into Qt sub-processes

There are several approaches to allow Squish to hook into Qt sub-processes. One of them must be fully implemented.

Approach #1: Replace Qt AUT’s .exe file with special dllpreload.exe variant

To support hooking of sub-processes dllpreload.exe supports a special mode. To use this do the following:

(sub_process.exe stands for the .exe file name of sub-process.)

Approach #2: Start Qt sub-process via dllpreload from Windows application

This is explained at Recording the Sub-Processes started by the AUT .

Approach #3: Add built-in hook to Qt application

This is explained at Using the Built-in Hook .

(Please do not forget to enforce the built-in hook in case of Windows.)

Creating and recording a new test case

To create a new test case register the Windows application as a Mapped AUT in the Squish IDE and use the following test script (Python example) as a starting point:

def main():
    aut = "win_app"
    testSettings.setWrappersForApplication(aut, ("Windows"))
    startApplication(aut)
    snooze(1)
test.py

To record set a breakpoint on the snooze(1) line and execute to it. Once at the breakpoint the Squish IDE should show up again. Then choose “Squish"|"Record Snippet” from the Squish IDE menu.

To end recording click on “End Recording” in Squish control bar, then stop test case execution to have the recorded snippet inserted into the test script at the breakpoint.

How to Test Multiple AUTs from a Single Test Script, Using ApplicationContext

Application Context

Recording on other applications