Skip to main content

robotframework-xlibrary-result

PyPI version Python versions Robot Framework License: MIT

Rich, self-contained HTML reports for Robot Framework — API logging, deep-diff comparison, JSON Schema validation, image diffing, and annotated screenshots in a single test_result.html.


Table of Contents


Features

  • Self-contained HTML report — single file, no external assets, ready to share or attach to CI artifacts.
  • API request / response logger — headers, body, cURL preview, status badge, sensitive-data masking.
  • Deep-diff data comparator — Dict ↔ Dict, List ↔ List, Dict ↔ List with 3 viewer modes (Table / JSON / Inline).
  • JSON Schema validation — Draft-7 with tree-style error rendering.
  • Image comparison — pixel, histogram, template-matching, and ORB feature algorithms.
  • Cross-platform screenshots — desktop, Android (ADB), iOS (xcrun), and Flutter; auto-annotated.
  • Zero-config defaults — bundled report.yaml works out-of-the-box; project-level YAML overrides automatically picked up.

Installation

pip install robotframework-xlibrary-result

Optional extras:

Extra Adds Use when
[schema] jsonschema You need VALIDATE JSON SCHEMA
[imaging] opencv-python, imageio You need template / ORB image diff
[all] All of the above You want everything bundled
pip install "robotframework-xlibrary-result[all]"

Quick Start

*** Settings ***
Library    robotframework_xlibrary_result.XLibraryResult
Library    RequestsLibrary

Suite Setup       Init Report
Suite Teardown    Finalise Report

*** Variables ***
${REPORT_PATH}    ${OUTPUT_DIR}/test_result.html
@{EXEC_RESULTS}   @{EMPTY}

*** Test Cases ***
TC01 — Get user list
    SET CURRENT TEST CASE ID    TC01
    APPEND STEP TITLE           Execution
    ${resp}=    GET    https://api.example.com/users
    Append Request and Response to HTML Report
    ...    GET /users    PASS    request_data=${None}    response_data=${resp.json()}
    ...    http_method=GET    http_status_code=${resp.status_code}    url=${resp.url}
    Compare Dict to Dict    ${resp.json()}    {"status": "ok"}    Verify status field

*** Keywords ***
Init Report
    ${LIB}=    Get Library Instance    robotframework_xlibrary_result.XLibraryResult
    ${EMPTY}=  Create Dictionary
    Setup Generate HTML Report    ${LIB}    ${REPORT_PATH}    Demo Suite
    ...    ${EMPTY}    ${EMPTY}    Robot Framework user

Finalise Report
    Write Steps To HTML    ${REPORT_PATH}    PASS    ${EXEC_RESULTS}

More runnable examples: see examples/.


Keyword Reference

Setup & Lifecycle

Keyword Purpose
Load Report Config Load report.yaml (project or bundled default)
Setup Generate HTML Report Initialise the report at suite start
Write Steps To HTML Flush collected steps to the final HTML at suite teardown
SET CURRENT TEST CASE ID Bind the active test case for subsequent steps

Step Logging

Keyword Purpose
APPEND STEP TO HTML RESULT Add a generic step (status badge, duration, attachments)
APPEND STEP TITLE Add a section title
APPEND STEP SUB TITLE Add a sub-section title
Capture Screenshot Capture & attach an annotated screenshot
Generate Execution Results From Steps Build the suite-level execution summary
ANALYZE REPORT ON TEST RESULT Post-run analysis of report contents

API Logging

Keyword Purpose
APPEND STEP REQUEST HTML RESULT Log a single HTTP request (headers / body / cURL)
Append Request and Response to HTML Report Log request + response side-by-side
VALIDATE RESPONSE WITH HTML Validate a response and embed the result

Data Comparison

Keyword Purpose
Compare Dict to Dict Deep-diff two dicts
Compare List of Dict to List of Dict Deep-diff two lists of dicts (per-item card view)
Compare Dict to List of Dict Match a dict against a list-of-dicts

Validation & Imaging

Keyword Purpose
VALIDATE JSON SCHEMA Validate JSON against Draft-7 schema
xCompare Images Compare two images (pixel / histogram / template / ORB)

Configuration

The library searches upwards from your test file for CONFIG/REPORT_CONFIG/report.yaml. If none is found, it falls back to the bundled defaults/report.yaml — so it works out-of-the-box with zero setup.

Override only the keys you care about:

project:
  name: "My Awesome API"
  logo: "https://example.com/logo.png"
  subtitle: "Smoke + regression"

tool:
  version: "v2.5.1"

footer:
  powered_by: "Powered by Robot Framework"
  copyright: "© {year} Acme Corp"

report:
  auto_open: true
  filename: "smoke_2025_q4"

Full schema with comments: defaults/report.yaml.


Compatibility

Supported
Python 3.9 – 3.13
Robot Framework 6.0+
OS macOS, Linux, Windows

Development

git clone https://github.com/Khrx1999/robotframework-xlibrary-result.git
cd robotframework-xlibrary-result
pip install -e ".[dev,all]"

pytest                  # run smoke tests
ruff check src tests    # lint
python -m build         # build sdist + wheel

Contributions welcome — please open an issue first to discuss significant changes. See CHANGELOG.md for release notes.


License

MIT — see LICENSE.

Copyright © 2026 Tassana Khrueawan.

Metadata

Release files for robotframework-xlibrary-result 1.0.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 robotframework-xlibrary-result 1.0.1
File Size Uploaded Provenance Actions
robotframework_xlibrary_result-1.0.1.tar.gz 140.0 kB Without provenance Details for robotframework_xlibrary_result-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for robotframework-xlibrary-result 1.0.1
File Interpreter ABI Platform Actions
robotframework_xlibrary_result-1.0.1-py3-none-any.whl Python 3 none any Details for robotframework_xlibrary_result-1.0.1-py3-none-any.whl

Total release size: 286.0 kB

Release files / robotframework_xlibrary_result-1.0.1.tar.gz

Download URL robotframework_xlibrary_result-1.0.1.tar.gz
Size 140.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5c10ec55252b17e30aed9bdc5743b00df0ef82f2d143fa67149b2370c0ab7975
BLAKE2b-256 checksum
How to use checksums
6ea312e26b231aed7bfae2a3d3f3ad69fb8bd3e1f2f59d541d24ff79694465b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.1

Release files / robotframework_xlibrary_result-1.0.1-py3-none-any.whl

Download URL robotframework_xlibrary_result-1.0.1-py3-none-any.whl
Size 145.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58b35627b8ba403d3b5d7e8c7943b89bba2ea53adb091cd8dcf668954e3cb4e1
BLAKE2b-256 checksum
How to use checksums
e62663e1c1f173dc6e0ba5493680a853858bccc19f8e3c2769e1cbd620a87015
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.1

Security for robotframework-xlibrary-result 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

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