Note: This post was triggered by a blog post on David Burns’ Blog which states that FirefoxDriver will stop working at version 47 of Firefox.
It is easy to switch to using the new
- I suggest you try it on your code, and if your tests work, then keep using it.
- If your tests fail, then it is most likely some defects in the newer
MarionetteDriver. In which case:
Steps to switch:
- Download the marionette driver
- Unarchive it to a folder of your choice
- In your code set the
"webdriver.gecko.driver"property to the location of the
- Use the
The above is slightly different from the official instructions on the page.
The official instructions suggest you:
- rename the file to ‘wires.exe’ and
- add it to your path.
I did rename it to
wires.exe, mainly to keep the code consistent so I wouldn’t have to update the code everytime I change the version of the marionette driver.
But I didn’t add it to the path. I’d rather control that in the code when the option is provided.
Firefox 45 and 46 my start driver code looks like this:
WebDriver driver = new FirefoxDriver();
Firefox 47 and above my code looks like this:
String currentDir = System.getProperty("user.dir"); String marionetteDriverLocation = currentDir + "/tools/marionette/wires.exe"; System.setProperty("webdriver.gecko.driver", marionetteDriverLocation); WebDriver driver = new MarionetteDriver();
I have a working example of this in the
startUsingSeleniumWebDriver code on github: