Skip to content

Instantly share code, notes, and snippets.

@migonzalvar
Created August 2, 2016 18:20
Show Gist options
  • Save migonzalvar/55cd8cb325e8ae7cd9ae9097ae4af562 to your computer and use it in GitHub Desktop.
Save migonzalvar/55cd8cb325e8ae7cd9ae9097ae4af562 to your computer and use it in GitHub Desktop.
Proof of concept Marionette, the next generation of FirefoxDriver.

Proof of concept Marionette, the next generation of FirefoxDriver.

Install recent firefox

Download recent firefox, for instance latest aurora, and install.

$ wget https://download-installer.cdn.mozilla.net/pub/firefox/nightly/latest-mozilla-aurora/firefox-49.0a2.en-US.linux-x86_64.tar.bz2
$ tar xjf firefox-49.0a2.en-US.linux-x86_64.tar.bz2
$ mv firefox firefox-latest
$ sudo mv firefox-latest /opt/

Install geckodriver

Download latest geckodriver and copy it to a dir in the PATH. As of selenium==2.53.6 it is necessary to add an alias as wires.

$ wget https://github.com/mozilla/geckodriver/releases/download/v0.9.0/geckodriver-v0.9.0-linux64.tar.gz
$ tar xzf geckodriver-v0.9.0-linux64.tar.gz
$ sudo cp geckodriver /usr/local/bin/
$ sudo ln -s /usr/local/bin/geckodriver /usr/local/bin/wires

Finally, configure selenium code:

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

caps = DesiredCapabilities.FIREFOX
caps["marionette"] = True
caps["binary"] = "/opt/firefox-latest/firefox"

driver = webdriver.Firefox(capabilities=caps)

driver.get("http://www.python.org")
assert "Python" in driver.title

See https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment