Skip to main content

selenium-screenshot-compare

Compare a website's rendering between two Firefox versions through a click-based navigation scenario. At each step, both full-page renders are captured and their pixel difference is measured.

Usable from plain Python or as a Robot Framework library.

Installation

uv add selenium-screenshot-compare
# or pip install selenium-screenshot-compare

You need two Firefox binaries (your system Firefox + a second version). See docs/firefox-setup.md for how to get one.

Quick start — Python

from selenium_screenshot_compare import DualSession, compare_images

session = DualSession("/usr/bin/firefox", "./firefoxes/firefox-128esr/firefox")
session.open("https://example.com")
session.click("css=a.nav-link")
session.capture_both("a.png", "b.png")
result = compare_images("a.png", "b.png", "diff.png")
print(f"{result.percent:.2f} % difference")
session.close()

Quick start — Robot Framework

uv add selenium-screenshot-compare[robot]
# or: pip install selenium-screenshot-compare[robot]
robot --outputdir output/robot tests/interactive_navigation.robot
Open Versions    ${SITE}    ${FIREFOX_A}    ${FIREFOX_B}
Capture And Compare    home    ${CAPTURES_DIR}
Click Element    css=a[href="/photographie"]
Capture And Compare    after-click    ${CAPTURES_DIR}
[Teardown]    Close Versions

Keywords

Keyword Role
Open Versions open the URL in both Firefox instances
Go To navigate to a URL
Click Element click (css=, id=, xpath=…)
Input Text type text
Go Back previous page
Capture And Compare capture + diff + result.json
Load Storage State inject cookies + localStorage (authenticated session)
Close Versions close both browsers

Output

Each Capture And Compare produces a folder with version_a.png, version_b.png, diff.png, and a result.json:

{
  "difference_percent": 0.0,
  "first_diff_y": null,
  "firefox_a": "152.0.1",
  "firefox_b": "128.0"
}

Documentation

License

MIT

Metadata

Release files for selenium-screenshot-compare 0.3.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 selenium-screenshot-compare 0.3.0
File Size Uploaded
selenium_screenshot_compare-0.3.0.tar.gz 85.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for selenium-screenshot-compare 0.3.0
File Interpreter ABI Platform
selenium_screenshot_compare-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 98.5 kB

Release files / selenium_screenshot_compare-0.3.0.tar.gz

Download URL selenium_screenshot_compare-0.3.0.tar.gz
Size 85.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9dfda9a1f046bcc88870ce063dbe0b4e8eafc98b750c9c3c0d20e52eabc1ba06
BLAKE2b-256 checksum
How to use checksums
acbae6adb858dd9990020563040010f1d90a28827d23c25abcd29e023b2ea3df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 2, 2026.

Transparency log

Release files / selenium_screenshot_compare-0.3.0-py3-none-any.whl

Download URL selenium_screenshot_compare-0.3.0-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee08614518a6fa5b10861bbc923f914ea1a8c7f401945d020fe0db9d0a4dc710
BLAKE2b-256 checksum
How to use checksums
5c1be849d5723ec64452418f3e0f7f9d4379139f4c9b0ddb97c4eef3c1d4c2da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.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