Qt Agent Introduction

Two components are used when CukeTest runs Qt Automation: Qt Automation Service (Qt Service, hereinafter referred to as Qt Service) and Qt Agent. Both are running in the CukeTest process and the Qt application process under test. The automated operation is completed through the interaction between the two.

Qt Automation Service

Qt services are globally unique, that is, only one service is running on a machine. The Qt service is always kept in the background with the start of CukeTest. You can observe that the service is running in the status bar in the lower right corner.

Qt service in the status bar The number behind represents the Qt application connected to the current service. As for how to connect the Qt application to the service, you can see the introduction in the next section-Qt Agent.

Since the Qt service uses a port to communicate with the application, it is globally unique. Only one instance of CukeTest (either the command line or the designer) can start the Qt service at the same time. In this regard, CukeTest coordinates the start of the Qt service as follows:

  1. If the designer has started the Qt service when the CukeTest command line is executed: the command line will stop the designer's Qt service and start its own Qt service. After completing the command line, if you need to re-enable the designer's Qt service, you need to manually start it from the status bar in the lower right corner. See Linux command line introduction for details.
  2. If there is a conflict of Qt service usage between multiple designers: When multiple CukeTest designers are started, the information that the Qt service is occupied will be prompted, just follow the instructions to restart the Qt service.

Reopen Qt service

If your use does not involve Qt automation (such as pure Web automation, API automation, etc.), you can turn off the Qt service and set it through the Qt Automation option in "File"-"Settings"-"Advanced". Avoid the above prompts caused by the transfer behavior of the Qt service.

Qt Agent

When CukeTest starts the Qt application, it loads the Qt Agent in the Qt application process so that CukeTest can operate the application through the Qt service. For the method to start Qt application with agent, please refer to the introduction of Start Qt Application.

Qt Agent's boot

Qt Agent will select the appropriate version according to the target application, such as:

  • Qt 4.x applications will load Qt 4.x Qt Agent;
  • Qt 5.x applications will load Qt 5.x Qt Agent;
  • If the target application is not a Qt application: Qt Agent does not do anything.

Manually load Qt Agent——Configure LD_PRELOAD environment variable

In the Command line launch Qt application section, you can initially understand that the method of loading Qt Agent is to modify the LD_PRELOAD environment after the startup command. variable. This is also a point to pay more attention to when performing Qt automation.

Chinese version click here.

results matching ""

    No results matching ""