c# Selenium 2.53 moving to marionette driver after firefox upgrade to 47

     InspiredX3 picture InspiredX3 · Jun 11, 2016 · Viewed 11.6k times · Source

I am trying to move into the upgraded firefox web browser automation using selenium. It seems that selenium needs marionette driver to continue working. I followed the instructions set by the devs,

  1. downloaded the driver
  2. renamed it to wires.exe

The following code didnt manage to properly set the PATH to a custom path.

System.Environment.SetEnvironmentVariable("webdriver.gecko.driver", "@C:\DOWNLOADS\wires.exe")

so i added wires.exe to the debug\bin folder and then wires.exe worked properly but i got the following error

System.InvalidOperationException was caught Message=entity not found Source=WebDriver

this is the code i use to start webdriver

FirefoxOptions option1 = new FirefoxOptions();
option1.IsMarionette = true;
option1.AddAdditionalCapability("marionette", true);
driver = new FirefoxDriver(option1);

Answer

Charles Cartwright picture Charles Cartwright · Jun 14, 2016

I too got the "Entity Not Found" error using FirefoxDriver(new FirefoxOptions()). It appears to be looking for firefox.exe in C:\Program Files (x86)\Nightly and not finding it. I found this working :

FirefoxDriverService service = FirefoxDriverService.CreateDefaultService();
service.FirefoxBinaryPath = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";
IWebDriver driver = new FirefoxDriver(service);