Skip to main content

A QGIS Robot Framework for QGIS UI automation and QGIS UI Testing

Project description

RB Logo QGIS 3.0 Logo


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

Robot Framework Documentation

QGISLibrary Documentation

Project details


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.2.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qgislibrary-1.7.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file qgislibrary-1.7.2.tar.gz.

File metadata

  • Download URL: qgislibrary-1.7.2.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

Hashes for qgislibrary-1.7.2.tar.gz
Algorithm Hash digest
SHA256 fd487257c1a5e3dd59cfad519fc538b46fbbac9f2790f102af7815d61f89a3fd
MD5 39a24576d7c445d0a586684cbf9a3bb0
BLAKE2b-256 d3080db33673aa19f1aec4674e76f5991f2d215f5f5e37fcbbf4f985addaa247

See more details on using hashes here.

File details

Details for the file qgislibrary-1.7.2-py3-none-any.whl.

File metadata

  • Download URL: qgislibrary-1.7.2-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

Hashes for qgislibrary-1.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8cf5acfa64fd95768bbaf82ef6e7eb833f15ca34960fef08b3a584d2dd6eede2
MD5 979459bf671194175ba46d83f2c23d31
BLAKE2b-256 a481fdb1847d1a54ccdfa60aeb7f559abb269f4f278d4abc9cb46081e724da5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page