{"id":24009,"library":"marionette-driver","title":"Marionette Driver","description":"A Python client for controlling Gecko-based browsers (Firefox, Firefox OS) via the Marionette protocol. Version 3.7.0, actively maintained with irregular releases.","status":"active","version":"3.7.0","language":"python","source_language":"en","source_url":"https://github.com/mozilla-b2g/marionette","tags":["marionette","firefox","geckodriver","browser-automation","testing"],"install":[{"cmd":"pip install marionette-driver","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for launching Firefox binaries in some test harnesses","package":"mozrunner","optional":true},{"reason":"Used for Python 2/3 compatibility (though library now requires Python >=3.8)","package":"six","optional":true}],"imports":[{"note":"The package is 'marionette_driver' (underscore), not 'marionette'","wrong":"from marionette import Marionette","symbol":"Marionette","correct":"from marionette_driver.marionette import Marionette"},{"note":"Commonly used for explicit waits","symbol":"Wait","correct":"from marionette_driver.wait import Wait"},{"note":"Used to specify element location strategies","symbol":"By","correct":"from marionette_driver.by import By"}],"quickstart":{"code":"from marionette_driver.marionette import Marionette\n\nclient = Marionette(host='localhost', port=2828)\nclient.start_session()\nclient.navigate('https://example.com')\nprint(client.title)\nclient.delete_session()","lang":"python","description":"Connects to a running Firefox instance with Marionette enabled (--marionette flag) or a GeckoDriver server."},"warnings":[{"fix":"Use 'from marionette_driver.marionette import Marionette'","message":"In version 3.0.0, the 'Marionette' class was moved from 'marionette.marionette' to 'marionette_driver.marionette'. Old imports will fail.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Call 'start_session(capabilities={\"marionette\": True})' instead.","message":"The 'start_session' method parameters changed: 'timeout' and 'page_load_strategy' are now deprecated in favor of a capabilities dict. Using positional arguments may break in future releases.","severity":"deprecated","affected_versions":">=3.5.0"},{"fix":"Start Firefox with 'firefox --marionette' or use geckodriver before connecting.","message":"The library expects a running Marionette server (Firefox with --marionette or geckodriver). It does not launch the browser automatically.","severity":"gotcha","affected_versions":"all"},{"fix":"Set environment variable MARIONETTE_HOST and MARIONETTE_PORT if not default.","message":"When using with geckodriver, the host and port must match the geckodriver's listening address (default localhost:2828).","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":"Install the correct package with 'pip install marionette-driver', then import from 'marionette_driver'.","cause":"Wrong import path; the package is 'marionette_driver'.","error":"ImportError: No module named 'marionette'"},{"fix":"Start Firefox with the --marionette flag or launch geckodriver before connecting.","cause":"No Marionette server is running on the specified host:port.","error":"marionette_driver.errors.MarionetteException: Connection refused"},{"fix":"Upgrade to the latest version: 'pip install --upgrade marionette-driver'","cause":"Outdated library version (<3.0) where the API was different.","error":"AttributeError: 'Marionette' object has no attribute 'start_session'"},{"fix":"Use capabilities dict: 'client.start_session(capabilities={\"marionette\": True})'","cause":"Passing deprecated parameters as keyword arguments in recent versions.","error":"TypeError: start_session() got an unexpected keyword argument 'timeout'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}