Skip to main content

RB Logo QGIS 3.0 Logo


QGISLibrary

A Robot Framework library that provides reusable keywords for QGIS UI Automation and 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 HTML report of task/test execution
  • Capture screenshots and logs
  • Supported OS: Windows (PyWinAuto, PyAutoGUI), Linux and MacOS not yet supported

Example of Robot Framework file

qgis_sample.robot

*** Settings ***
Documentation     This is an example QGIS Robot Framework file
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
Library           QGISLibrary
Library           Screenshot

*** Variables ***
${QGIS_FILEPATH}    C:\\Program Files\\QGIS 4.0.3\\bin\\qgis-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 Args    ${MAIN_WINDOW}    title=Otwórz…    control_type=Button
    Mouse Left 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


Robot Framework Editor

  • Use RIDE to edit .robot files:
  • Run command via terminal
pip install robotframework-ride
ride

Links

QGIS Documenation

Robot Framework Documentation

QGISLibrary Documentation

Release files for QGISLibrary 1.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for QGISLibrary 1.8.0
File Size Uploaded
qgislibrary-1.8.0.tar.gz 11.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for QGISLibrary 1.8.0
File Interpreter ABI Platform
qgislibrary-1.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.1 kB

Release files / qgislibrary-1.8.0.tar.gz

Download URL qgislibrary-1.8.0.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b51d9a8930e49befca98e3e0af4dfebcd7da992fa54d99127a343e8cc9131f5c
BLAKE2b-256 checksum
How to use checksums
26050df79ace6048ed5641eff3b363c612ef6932ff960a189142b95824dabeb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / qgislibrary-1.8.0-py3-none-any.whl

Download URL qgislibrary-1.8.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2091123c0df696b528b1fa9dcefdab3821bc695e507f1b9aea6ef7c6c5f599a0
BLAKE2b-256 checksum
How to use checksums
84bc1c8a1de93c693e60454b3519a54ba09a4af4902d0b0ee3048e1c307a060e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

1.8.0 This release

2 release files

1.7.10

2 release files

1.7.9

2 release files

1.7.8

2 release files

1.7.7

2 release files

1.7.6

2 release files

1.7.5

2 release files

1.7.4

2 release files

1.7.3

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7

2 release files

1.6

2 release files

1.5

2 release files

1.4

2 release files

1.3

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page