Compare a website's rendering between two Firefox versions driven in parallel via Selenium (Python + Robot Framework library).
Project description
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
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
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
- Firefox setup — getting a second Firefox binary (Linux / Windows / macOS)
- Authenticated sessions — comparing pages behind a login
- Windows notes — venv paths, Firefox paths, running suites
- Contributing — development setup, linting, CI, releasing
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file selenium_screenshot_compare-0.1.2.tar.gz.
File metadata
- Download URL: selenium_screenshot_compare-0.1.2.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5590c3bf1121f70ec5f5edc4f7b0beb49e1871d198e884c2f5796e99bd946a25
|
|
| MD5 |
c5bc8a43711ba7254cc1122c1e1d4b78
|
|
| BLAKE2b-256 |
7b937adec7b3d27414895f653c5defe6a0b6eb72dcb5260331e2098ae8371555
|
Provenance
The following attestation bundles were made for selenium_screenshot_compare-0.1.2.tar.gz:
Publisher:
auto-tag.yml on EAnathos/selenium-screenshot-compare
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
selenium_screenshot_compare-0.1.2.tar.gz -
Subject digest:
5590c3bf1121f70ec5f5edc4f7b0beb49e1871d198e884c2f5796e99bd946a25 - Sigstore transparency entry: 2142688362
- Sigstore integration time:
-
Permalink:
EAnathos/selenium-screenshot-compare@96ff0eb43e855c0daee79fbcdcff563742687a4d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/EAnathos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
auto-tag.yml@96ff0eb43e855c0daee79fbcdcff563742687a4d -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file selenium_screenshot_compare-0.1.2-py3-none-any.whl.
File metadata
- Download URL: selenium_screenshot_compare-0.1.2-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
888e8658974ffd36c12612ae471d55bbd6097696d7cef5e4f1f56955c6492533
|
|
| MD5 |
facf5f5bc87d552bbe3a7360342ebe0e
|
|
| BLAKE2b-256 |
3cef13508e9e7932ee669fc2b0e9bc4c4394f2a8917531afceab21552636a23c
|
Provenance
The following attestation bundles were made for selenium_screenshot_compare-0.1.2-py3-none-any.whl:
Publisher:
auto-tag.yml on EAnathos/selenium-screenshot-compare
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
selenium_screenshot_compare-0.1.2-py3-none-any.whl -
Subject digest:
888e8658974ffd36c12612ae471d55bbd6097696d7cef5e4f1f56955c6492533 - Sigstore transparency entry: 2142688384
- Sigstore integration time:
-
Permalink:
EAnathos/selenium-screenshot-compare@96ff0eb43e855c0daee79fbcdcff563742687a4d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/EAnathos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
auto-tag.yml@96ff0eb43e855c0daee79fbcdcff563742687a4d -
Trigger Event:
pull_request
-
Statement type: