Skip to main content

A library based on Robot Framework for QGIS UI Automation and Testing

Project description

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

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.8.0.tar.gz (11.1 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.8.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qgislibrary-1.8.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for qgislibrary-1.8.0.tar.gz
Algorithm Hash digest
SHA256 b51d9a8930e49befca98e3e0af4dfebcd7da992fa54d99127a343e8cc9131f5c
MD5 5348317e8304ea2092316074f7608cb1
BLAKE2b-256 26050df79ace6048ed5641eff3b363c612ef6932ff960a189142b95824dabeb1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qgislibrary-1.8.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for qgislibrary-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2091123c0df696b528b1fa9dcefdab3821bc695e507f1b9aea6ef7c6c5f599a0
MD5 035f44243541d83a56a790681a316720
BLAKE2b-256 84bc1c8a1de93c693e60454b3519a54ba09a4af4902d0b0ee3048e1c307a060e

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