3

Could someone please help me with the following issue.

While I'm trying to initialize a browser I get the 'os error' exception.

var option = new FirefoxOptions();
option.IsMarionette = true;
var driver = new FirefoxDriver(option);

var b = new Browser(driver); // Throws an exception with a message - 'os error'

The screenshot of the exception

Plese note, the path to wires.exe is added to the system PATH. Selenium, wires, firefox are of the latest versions. I have tried running using firefox-stable and firefox-developer editions.

Thanks.

tenorsax
  • 21,123
  • 9
  • 60
  • 107
csprv
  • 59
  • 8

2 Answers2

2

So I ran into the 'os error' issue when I was trying to get Marionette working. The source of the issue in my case was I was trying to use some NuGet package called 'Mozilla Firefox Webdriver 0.6.0.1' which I believe had a very old version of the (now called) geckodriver.exe.

I downloaded the latest version of the driver from here https://github.com/mozilla/geckodriver/releases renamed to wires.exe and put in my working directory then I had to initiate the driver using the following code.

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

The way you initated the driver was giving me an entity not found exception.

Hope this helps

Buster
  • 685
  • 1
  • 5
  • 28
0

Maybe DesiredCapabilities would work.

   DesiredCapabilities capabilities = DesiredCapabilities.Firefox();
   capabilities.SetCapability("marionette", true);
   var driver = new FirefoxDriver(capabilities);
unickq
  • 1,497
  • 12
  • 18
  • actually DesiredCapabilities.Firefox() works, but the tests starts over selenium not marionette. I've checked it by deleting the wires.exe. – csprv Mar 14 '16 at 11:10
  • yes, I am facing the same issue. Caps do not start the marionette driver. Anyone has solution for this, please suggest. – rahoolm Jun 17 '16 at 07:15