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    4.0.3-Norrköping
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

QGIS Documenation

Robot Framework Documentation

QGISLibrary Documentation

Metadata

Release files for QGISLibrary 1.8.1

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.1
File Size Uploaded
qgislibrary-1.8.1.tar.gz 11.2 kB Details

Built distribution (wheel)

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

Total release size: 21.1 kB

Release files / qgislibrary-1.8.1.tar.gz

Download URL qgislibrary-1.8.1.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bded37c3f3f5f2a5454a82e68e296db858e06f9268ff0e6abafce34195c5c2ff
BLAKE2b-256 checksum
How to use checksums
8b1cbce2798f93b95f32d7aaeb3ba80096442da3a2c0d0de71c059f7a753d796
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.1-py3-none-any.whl

Download URL qgislibrary-1.8.1-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04652efdc1f299481c9fa5cbe916fcdcdad1cbcc7bcb56643894f6434fd7fa4d
BLAKE2b-256 checksum
How to use checksums
f3ad253abbec39552b3a522b0e592a1c01c955b65fcd0106f02270fa610b4eac
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.1 This release

2 release files

1.8.0

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