The selenium client bindings can attempt to find the geckodriver executable from the system PATH. You will have to add the directory containing the executable to the system path.
On UNIX systems you'll do the following to append it to your system’s search path if you’re employing a bash-compatible shell:
On Windows, you wish to update the path system variable to feature the complete directory path to the executable. The principle is the same as on Unix. All below configuration for launching the latest firefox using any programing language binding is applicable for Selenium2 to enable marionette explicitly. With selenium 3.0 and later, you should not need to do anything to use marionette, as it's enabled by default.
To use marionette in your tests you may have to update your required capabilities to use it.
//if you didn't update the Path system variable to add the full directory path to the executable as above mentioned then doing this directly through code
//Now you can Initialize marionette driver to launch firefox
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
WebDriver driver = new MarionetteDriver(capabilities);
And for Selenium3 use as:-
WebDriver driver = new FirefoxDriver();
var driver = new FirefoxDriver(new FirefoxOptions());
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
caps = DesiredCapabilities.FIREFOX
# Tell the Python bindings to use Marionette.
# This will not be necessary for the future,
# when Selenium will auto-detect what remote end
# it is talking to.
caps["marionette"] = True
# Path to Firefox DevEdition or Nightly.
# Firefox 47 (stable) is currently not supported,
# and may give you a suboptimal experience.
# On Mac OS you must point to the binary executable
# inside the application package, such as
caps["binary"] = "/usr/bin/firefox"
driver = webdriver.Firefox(capabilities=caps)
# Selenium 3 uses Marionette by default when firefox is specified
# Set Marionette in Selenium 2 by directly passing marionette: true
# You might need to specify an alternate path for the desired version of Firefox
Selenium::WebDriver::Firefox::Binary.path = "/path/to/firefox"
driver = Selenium::WebDriver.for :firefox, marionette: true
const webdriver = require('selenium-webdriver');
const Capabilities = require('selenium-webdriver/lib/capabilities').Capabilities;
var capabilities = Capabilities.firefox();
// Tell the Node.js bindings to use Marionette.
// This will not be necessary in the future,
// when Selenium will auto-detect what remote end
// it is talking to.
var driver = new webdriver.Builder().withCapabilities(capabilities).build();