Many of you know that Selenium 3.0 beta has been released and in this version of Selenium, you can open Firefox in a different way. You need to use Marionette (Gecko) driver to launch Firefox. Before Selenium 3.0 we can launch Firefox by default without any property settings. On the other hand, we need ChromeDriverServer and IEDriverServer executables for chrome and Internet Explorer browsers. Now, with Selenium 3.0 we need to set Marionette (Gecko) driver executable to use Firefox and in this article I will show you how to accomplish this.

Marionette is the next generation of FirefoxDriver.

Step by Step Explanations to use Marionette Driver

Method 1: Set Marionette Driver path as webdriver.gecko.driver Property

Step-1: Go to https://github.com/mozilla/geckodriver/releases and download latest release of geckodriver.

marionette

Step-2: Create a new folder as “C:\Marionette” and extract the zip file inside this folder.

gecko

Step-3: Now, we should set webdriver.gecko.driver System property to the “C:\Marionette\geckodriver.exe” path.

Test Code:

Test Result:

marionette

Method 2: Set Marionette path as Environmental Variable

Step-1: Copy the geckodriver.exe’s folder path. In our case it is “C:\Marionette

Step-2: Use RapidEE or go to Windows System Properties -> Environmental Variables  and then click to Path and add this folder to Path variable.

gecko

Step-3: Restart the PC that your settings take effect!

After restart, you can directly create FirefoxDriver instance without set the System property every time. Your test code will look like this.