Registry / testing / mozrunner

mozrunner

JSON →
library8.4.0pypypi✓ verified 84d ago

A library to reliably start, stop, and configure Mozilla applications (Firefox, Thunderbird, etc.). Version 8.4.0 supports Python >=3.8. It wraps Mozilla processes with geckodriver or Marionette for automation and testing.

pip install mozrunner
INSTALL
IMPORT
SIG · MOZRUNNER
M
mozrunner
testingpythonv8.4.0
Install
3.7s avg
Import
474ms
Disk
26MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v8.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.500s · 30.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.7s · import 0.448s · 31MB
26MB installed
● package 26MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Runner
from mozrunner import Runner
mozrunner.Runner
Most classes are top-level in the mozrunner package, not nested.
FirefoxRunner
from mozrunner import FirefoxRunner
from mozrunner.runners import FirefoxRunner
FirefoxRunner is exported directly from mozrunner; no submodule needed.

Create a Firefox profile, start the browser, wait, then stop.

from mozrunner import FirefoxRunner from mozprofile import FirefoxProfile profile = FirefoxProfile() # or use addons/prefs runner = FirefoxRunner(binary='firefox', profile=profile) runner.start() print('Firefox started') runner.wait(timeout=60) runner.stop()
Debug
Known issues
gotchaBinary path must point to a Firefox/Thunderbird executable. If not found, Runner raises an OSError or fails silently. Always verify the binary path.
fix
Specify the full path or ensure 'firefox' is on PATH. Use shutil.which('firefox').
affects: all
deprecatedThe 'mozrunner.cli' module and command-line interface (CLI) are deprecated and may be removed in the future.
fix
Use the library API directly instead of the CLI wrapper.
affects: >=8.0.0
gotchaThe 'Runner' base class does not automatically download or update GeckoDriver. You must manage GeckoDriver separately for Firefox automation.
fix
Install geckodriver and ensure it's on PATH before using mozrunner with Marionette-based automation.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'mozrunner'
Package not installed or installed in a different virtual environment.
fix
Run `pip install mozrunner` in the correct environment.
AttributeError: module 'mozrunner' has no attribute 'Runner'
Outdated installation (version <8.0.0) where Runner was in a submodule.
fix
Upgrade: `pip install -U mozrunner`. Also check imports: use `from mozrunner import Runner`.
OSError: [Errno 2] No such file or directory: 'firefox'
The browser binary is not on PATH or the specified path is wrong.
fix
Pass the correct binary path: binary='/usr/bin/firefox' or use shutil.which('firefox').
Upgrade
Version history
8.4.0latest on PyPI · released Mar 26, 2026
Audit
Dependencies
mozprofilerequiredUsed internally to manage Firefox profiles.
mozprocessrequiredUsed to start/kill browser processes.
mozinforequiredProvides platform information for binary paths.
sixoptionalCompatibility layer for Python 2/3 (mostly deprecated usage).
Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
mozrunner — pip install mozrunner · libregistry