Qtghost is a Qt QML GUI events recording and playing library, intended for auto test.
- qtghost: QtGhost C++ library
- qtghost_test: QML to be tested (example).
- qtghost_pyinterface: Python interface to run tests (rec, play, set, get)
This library supports the following commands:
- record (-r): start recording user events (mouse clicks, moves);
- stop-recording (-s): stop recording user events;
- play (-p): start playing recorded user events (ghost mode);
- step (-e): play just one recorded user event (step);
- get-rec (-g): get the recorded user events in JSON format;
- set json (-j): sends recorded user events (in JSON format) to qtghost memory;
- ver (-v): shows the python (local) and library (remote) version info;
- screenshot (-s): gets application screenshot (remote) in PNG format;
JSON recorded events for set/get are transfered through TCP/IP connection (sockets). The provided client to interface Qtghost is written in Python.
Its provided as Python module (qtghost3), test script 'ghost.py' and a test file (ghoststream.json) recorded from QML example (qtghost_test).
To record events into qtqhost_test: $ python.exe .\ghost.py PORT rec
To stop recording events into qtqhost_test: $ python.exe .\ghost.py PORT stop
To play recorded events into qtqhost_test: $ python.exe .\ghost.py PORT play
To play just one recorded event into qtqhost_test: $ python.exe .\ghost.py PORT step
To get recorded events from qtqhost_test into a local JSON file (this command has an optional file name arg): $ python.exe .\ghost.py PORT get
To set recorded events into qtqhost_test (this command has an optional file name arg): $ python.exe .\ghost.py PORT set
Qt/QML example showing how to include the library into a QML software.