A QGIS Robot Framework for QGIS UI automation and QGIS UI Testing
Project description
QGISLibrary
A QGIS library for Robot Framework providing reusable keywords for QGIS UI automation and QGIS UI Testing.
Installation
Install via pip:
pip install QGISLibrary
Features
- Automate QGIS UI actions using section *** Tasks *** in robot file
- Test QGIS UI behaviours using section *** Test Cases *** in robot file
- Generate clear HTML report of task/test execution
- Capture screenshots and logs for test validation
- Integrates with Robot Framework for robust automated tests
- Supports Windows (via PyWinAuto) and cross-platform (via PyAutoGUI)
Example of Robot Framework file
# File: qgis_sample.robot
*** Settings ***
Documentation This is an example QGIS Robot Framework file
Library QGISLibrary
Library Screenshot
Suite Setup Set Metadata From Variables
Suite Teardown Log End of Suite
Metadata Author Michal Pilarski
Metadata Version 1.0.0
Metadata Environment TEST
Metadata QGIS Version 3.40.7-Bratislava
*** Variables ***
${QGIS_FILEPATH} C:\\Program Files\\QGIS 3.40.7\\bin\\qgis-ltr-bin.exe
${QGIS_PROFILE} default
*** Tasks ***
QGIS Init Task
[Documentation] Sample of QGIS Init Task
[Tags] dev qgis
[Setup] Log Start Task
[Teardown] Log End Task
Start Qgis ${QGIS_FILEPATH} ${QGIS_PROFILE}
# Connect Qgis ${QGIS_FILEPATH}
${MAIN_WINDOW} Main Window
${OPEN_PROJECT_BUTTON} Get Locator By Parent ${MAIN_WINDOW} title=Otwórz… control_type=Button
Mouse Click Locator ${OPEN_PROJECT_BUTTON} 1
Take Screenshot qgis_screenshot.jpg
# Kill Qgis
*** Keywords ***
Set Metadata From Variables
[Documentation] Set Suite Metadata
Set Suite Metadata QGIS FILEPATH ${QGIS_FILEPATH}
Set Suite Metadata QGIS PROFILE ${QGIS_PROFILE}
Usage
- Run command via terminal
robot qgis_sample.robot
- For help run via terminal
robot --help
- Open HTML Reports: report.html or log.html
QGIS UI Locators
- Use Inspect.exe to detect UI locators
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qgislibrary-1.7.3.tar.gz
(5.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qgislibrary-1.7.3.tar.gz.
File metadata
- Download URL: qgislibrary-1.7.3.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e4de4a35c240fe9a65429b6b3b9c3ce412b79f9bb4178c3551fb8bfe692ef1d
|
|
| MD5 |
4d433482f94c7795997fc8914de1d14a
|
|
| BLAKE2b-256 |
451311bbd8decf82baf02015546d497f4849a7e3d2ba1162a216eba801647b3b
|
File details
Details for the file qgislibrary-1.7.3-py3-none-any.whl.
File metadata
- Download URL: qgislibrary-1.7.3-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1177abc25d2563172895fd47a5ee1438c70d4a9debc9d9e8deb8df456320de00
|
|
| MD5 |
8e0e2e6fc5050794d61e91d31c6efa5c
|
|
| BLAKE2b-256 |
807b5df2941f550688c118666e60c37f5d3ae9e12a0dbefe6adb4a6c5841108c
|