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

11,626

Solution 1

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);

Solution 2

I try with this and it's working:

  1. Install FirefoxDevEdition
  2. Download geckodriver.exe

FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(@"C:\Users\jmalpartida\Downloads\geckodriver-v0.8.0-win32", "geckodriver.exe");
service.Port = 64444;
service.FirefoxBinaryPath = @"C:\Program Files (x86)\Firefox Developer Edition\firefox.exe";
IWebDriver driver = new FirefoxDriver(service);
Share:
11,626
     InspiredX3
Author by

InspiredX3

Updated on June 04, 2022

Comments

  •      InspiredX3
    InspiredX3 almost 2 years

    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);
    
  •      InspiredX3
    InspiredX3 almost 8 years
    do i have to use Remotewebdriver? There is the option to simply upgrade at the site you mentioned "Updating your tests to use Marionette" but only a simple line of code which is similar to the one i used. By the way the driver i downloaded is an exe file which i renamed to the file wires.exe. When u say to add the driver to system path you mean sth like "C:\Windows" am i correct?
  • johnstaveley
    johnstaveley almost 8 years
    I've tried this, doesn't work, I still get entity not found error
  • swathi
    swathi almost 8 years
    Excellent this works for me but is it possible to create marionette driver as shown above with firefoxprofile? I don't see any option to create driver with service and profile as inputs?