{"id":24070,"library":"mozrunner","title":"mozrunner","description":"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.","status":"active","version":"8.4.0","language":"python","source_language":"en","source_url":"https://github.com/mozilla/mozrunner","tags":["firefox","thunderbird","automation","testing","mozilla","geckodriver"],"install":[{"cmd":"pip install mozrunner","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used internally to manage Firefox profiles.","package":"mozprofile","optional":false},{"reason":"Used to start/kill browser processes.","package":"mozprocess","optional":false},{"reason":"Provides platform information for binary paths.","package":"mozinfo","optional":false},{"reason":"Compatibility layer for Python 2/3 (mostly deprecated usage).","package":"six","optional":true}],"imports":[{"note":"Most classes are top-level in the mozrunner package, not nested.","wrong":"mozrunner.Runner","symbol":"Runner","correct":"from mozrunner import Runner"},{"note":"FirefoxRunner is exported directly from mozrunner; no submodule needed.","wrong":"from mozrunner.runners import FirefoxRunner","symbol":"FirefoxRunner","correct":"from mozrunner import FirefoxRunner"}],"quickstart":{"code":"from mozrunner import FirefoxRunner\nfrom mozprofile import FirefoxProfile\n\nprofile = FirefoxProfile()  # or use addons/prefs\nrunner = FirefoxRunner(binary='firefox', profile=profile)\nrunner.start()\nprint('Firefox started')\nrunner.wait(timeout=60)\nrunner.stop()","lang":"python","description":"Create a Firefox profile, start the browser, wait, then stop."},"warnings":[{"fix":"Specify the full path or ensure 'firefox' is on PATH. Use shutil.which('firefox').","message":"Binary path must point to a Firefox/Thunderbird executable. If not found, Runner raises an OSError or fails silently. Always verify the binary path.","severity":"gotcha","affected_versions":"all"},{"fix":"Use the library API directly instead of the CLI wrapper.","message":"The 'mozrunner.cli' module and command-line interface (CLI) are deprecated and may be removed in the future.","severity":"deprecated","affected_versions":">=8.0.0"},{"fix":"Install geckodriver and ensure it's on PATH before using mozrunner with Marionette-based automation.","message":"The 'Runner' base class does not automatically download or update GeckoDriver. You must manage GeckoDriver separately for Firefox automation.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install mozrunner` in the correct environment.","cause":"Package not installed or installed in a different virtual environment.","error":"ModuleNotFoundError: No module named 'mozrunner'"},{"fix":"Upgrade: `pip install -U mozrunner`. Also check imports: use `from mozrunner import Runner`.","cause":"Outdated installation (version <8.0.0) where Runner was in a submodule.","error":"AttributeError: module 'mozrunner' has no attribute 'Runner'"},{"fix":"Pass the correct binary path: binary='/usr/bin/firefox' or use shutil.which('firefox').","cause":"The browser binary is not on PATH or the specified path is wrong.","error":"OSError: [Errno 2] No such file or directory: 'firefox'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}