QT Testing/en

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen

Deutsche Version | English Version

Pre-requisites[Bearbeiten]

Qt download[Bearbeiten]

https://www.qt.io/download

Supported Versions[Bearbeiten]

Expecco supports testing of Qt applications on Windows and Linux, Qt Quick/QML applications from Qt version 5'.

For the different Qt versions, operating systems, development environments (VisualStudio, ...) and computer architectures (32/64 bit) we provide specially generated libraries (dll, so). Some of them are delivered with expecco by default. For other versions we generate the library on request.

An overview of the delivered libraries and their version status can be found here.

Testing Qt Programs[Bearbeiten]

Test Preparations[Bearbeiten]

Integrating the ExpeccoTestService Library[Bearbeiten]

To test a Qt program with expecco, the library expeccoTestService.[dll/so] delivered by us is included in the program to be tested. This is done via a batch or shell script without intervention in the source code of the program to be tested.

You can also activate logging for the expeccoTestService library in the batch or shell script.

Instructions for the respective operating system of the test computer can be found here:

Alternatively, the ExpeccoTestService library call can be inserted into the source code of the application under test (Description).

Start Parameters[Bearbeiten]

The ExpeccoTestService library can be set via environment variables:

  • Log level: ETS_QT_LOG_LEVEL
0 no logging (default value)
before expecco version 24.1: 2: logging (debug)
from expecco version 24.1: 2 or DEBUG (debug), 3 or INFO (info), 4 or WARN (warnings and errors)
  • Log file: ETS_QT_LOG_FILE (default value: c:\Windows\temp\etsQt.log or /tmp/etsQt.log).
  • Server port: ETS_QT_PORT_NUMBER (default value: 8866).
  • Timeout preview in ms (only Qt Quick): ETS_TIMEOUT_QUICK_IMAGE (default value: 200)

Required Qt Libraries at Runtime[Bearbeiten]

The ExpeccoTestService library depends on the following Qt libraries:

  • Qt5Core
  • Qt5Gui
  • Qt5Network
  • Qt5Qml
  • Qt5Quick (V2 with Qt Quick integration (expecco 21.2))
  • Qt5QmlModel (V2 with Qt Quick integration (expecco 21.2))
  • Qt5Widgets

Connecting with Expecco GUI Browser[Bearbeiten]

The GUI Browser can be used to connect to the program under test:

Connect - Qt.

In the following dialog, enter the network address of the computer running the application and the port for the connection (8866 by default).

Manual GUI Browser.

Qt Quick/QML Programs[Bearbeiten]

Qt Quick/QML applications can be tested with the expecco QtLibrary starting with expecco 21.2.

For this purpose, a new ExpeccoTextService library with the name suffix V2 is delivered. The library depends on additional Qt libraries (see Required Qt Libraries at Runtime)

Only expecco 21.2

Only one ExpeccoTextService library is delivered, but it already offers Qt Quick/QML support. Only from version 22.1 two separate libraries are provided.


Qt Quick/QML Actions[Bearbeiten]

For testing Qt Quick/QML programs almost all actions of the QtLibrary can be used, which are defined for testing Qt programs based on QWidget / QApplication.

QWidget actions are applicable to Qt Quick items derived from QQuickItem. QQuickItemView actions are applicable to Qt Quick list items.

The different handling is encapsulated by the ExpeccoTestService. Thus, the action and the input and output pins remain the same for both Qt technologies.

The actions, which are also suitable for tests of Qt Quick/QML programmes, are provided with the label / tag qt-quick. The actions can thus be displayed with a configurable colour (Extras - Settings - Look & Feel - Colours per Label (Tag)).

Qt Quick/QML Peculiarities[Bearbeiten]

Control via Properties[Bearbeiten]

The basis of all Qt Quick/QML interface elements is the QQuickItem class. Most of its properties can be set via properties. There are many derivations of QQuickItem. Expecco does not provide any special building blocks for this, but the elements can be controlled via their properties.

Qt Quick element property Comment
Tumbler currentIndex
Switch checked Suitable actions:
QCheckButton::GetState
QCheckButton::SetState = %2
will be continued

Actions for Selected Element[Bearbeiten]

The display of actions for GUI elements in the GUI browser is not complete because Qt Quick/QML does not have predefined elements for each interface element.

Not yet implemented[Bearbeiten]

  • TreeView
  • Menu
  • Selection of cells - so far only one row can be selected

Qt Known Problems[Bearbeiten]

XPath implementation[Bearbeiten]

XPath can be used to search for matching names or index of elements. Filtering by name parts (starts-with, ends-with, contains) is currently not supported.

QApplication::ShortCutEvent[Bearbeiten]

Due to internal changes in Qt version 5, the module no longer works. A workaround is to send the key events separately, as shown in the example in the Test/Demo tab of the action.

ExpeccoTestService Library: Delivery in Expecco Versions[Bearbeiten]

List of Expecco versions with the latest update of the ExpeccoTestService library for the different Qt versions and build systems.

Further versions can be delivered on request.

Windows[Bearbeiten]

Expecco Version Qt Version Architecture Build System Directory Comment
2024-1 6.2.4 x64 vs2019 vs2019_x64_Qt6.2.4
  • Logging with Loglevels DEBUG, INFO and WARN
  • Mouse event Move has been revised (QT:OS-MouseEvent...)
5.15.0 x64 vs2022 vs2022_x64_Qt5.15.0
5.15.0 x64 vs2019 vs2019_x64_Qt5.15.0
2023-2 6.2.4 x64 vs2019 vs2019_x64_Qt6.2.4
  • New Step QButton::Click: Direct click, not delegated to thread
5.15.0 x64 vs2022 vs2022_x64_Qt5.15.0
5.15.0 x64 vs2019 vs2019_x64_Qt5.15.0
2023-1 6.2.4 x64 vs2019 vs2019_x64_Qt6.2.4
  • QT6 support
  • Bugfix QtQuick: MouseClick
5.15.0 x64 vs2019 vs2019_x64_Qt5.15.0
2022-2 5.15.0 x64 vs2019 vs2019_x64_Qt5.15.0
  • Output version and build date in etsLog at start-up
5.15.0 x86 vs2019 vs2019_Qt5.15.0
5.14.2 x86 vs2017 vs2017_Qt5.14.2
2022-1 5.15.0 x64 vs2019 vs2019_x64_Qt5.15.0
  • Separate DLLs for QtQuick/QWidget and only QWidget
  • Feature: Reading vertical headers for tables
  • Feature: Screenshot in case of error
5.15.0 x86 vs2019 vs2019_Qt5.15.0
5.14.2 x86 vs2017 vs2017_Qt5.14.2
2021-2 5.15.0 x64 vs2019 vs2019_x64_Qt5.15.0 QtQuick / QML
5.15.0 x86 vs2019 vs2019_Qt5.15.0
5.9.3 x64 vs2015 vs2015_x64_Qt5.9.3
5.9.1 x64 vs2015 vs2015_x64_Qt5.9.1
2021-1 5.9.3 x86 vs2015 vs2015_x86_Qt5.9.3
2020-1 5.8.0 x86 vs2013 vs2013_Qt5.8.0
2019-2 5.9.3 x64 vs2013 vs2013_x64_Qt5.9.3
5.9.1 x64 vs2013 vs2013_x64_Qt5.9.1
2018-2 5.4.2 x86 vs2010 vs2010_Qt5.4.2

Linux / macOS[Bearbeiten]

Expecco Version Qt Version Architecture Build System Directory Comment
2024-1 6.2.4 x64 gcc gcc_x64_Qt6.2.4
  • Logging with Loglevels DEBUG, INFO and WARN
5.15.0 x64 gcc gcc_x64_Qt5.15.0
2023-1 6.2.4 x64 gcc gcc_x64_Qt6.2.4 QT6 support
5.15.0 x64 gcc gcc_x64_Qt5.15.0
2022-2 5.15.0 x64 gcc gcc_x64_Qt5.15.0 Output version and build date in etsLog at start-up
2022-1 5.15.0 x64 gcc gcc_x64_Qt5.15.0
  • Separate DLLs for QtQuick/QWidget and only QWidget
  • Feature: Reading vertical headers for tables
  • Feature: Screenshot in case of error
2021-2 5.15.0 x64 gcc gcc_x64_Qt5.15.0 QtQuick / QML
2021-1 5.12.2 arm32 gcc gcc_arm32_Qt.12.2
5.9.5 x64 gcc gcc_x64_Qt5.9.5
2020-2 5.9.1 x64 gcc gcc_x64_Qt5.9.1
2020-1 5.12.3 x64 gcc gcc_x64_Qt5.12.3

Back to Qt Plugin Reference



Copyright © 2014-2024 eXept Software AG