8

I've been using Selenium (http://www.seleniumhq.org/) recently for testing purposes. It randomly stopped working and I believe this is due to Selenium WebDriver 2.53.0 not being compatible with Firefox 47 anymore (the WebDriver component which handles Firefox browsers (FirefoxDriver) has been discontinued).

Marionette ([https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver#.NET][2]) is the next generation of FirefoxDriver and I've been trying to get this to work on my machine but have had no luck.

I have so far downloaded the driver, renamed the file as wires.exe and saved in the root directory of my website. I have then added the following code:

string strWires = @"Z:\Web_Development\Websites\test\wires.exe";
Environment.SetEnvironmentVariable("webdriver.gecko.driver", strWires);

FirefoxOptions options = new FirefoxOptions();
options.IsMarionette = true;
FirefoxDriver driver = new FirefoxDriver(options);

I recieve the following error message however:

"An exception of type 'OpenQA.Selenium.DriverServiceNotFoundException' occurred in WebDriver.dll but was not handled in user code

Additional information: The wires.exe file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at github.com/jgraham/wires/releases."

It would be very much appreciated if anyone knows how to get the Marionette driver working with Selenium (or could even just point me in the right direction) and could provide step by step instructions?

Thanks,

Daniel

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
  • I got the same error message as you after I downloaded the file to C:/Windows and renamed it. When I unblocked it I now get OpenQA.Selenium.WebDriverException : Cannot start the driver service on http://localhost:49426/ – johnstaveley Jun 14 '16 at 09:44
  • If you put wires.exe in the path and execute it directly in a command prompt you get a message 'The program can't start because VCRUNTIME140.dll is missing from your computer'. This is available from here: https://www.microsoft.com/en-gb/download/details.aspx?id=48145 – johnstaveley Jun 14 '16 at 10:14
  • However, I've done this, installed it and it appears in C:/Windows/System32 and it still gives the same error. I've even run wires.exe from the same location. – johnstaveley Jun 14 '16 at 10:53
  • Ok, I installed the x86 version (as well) from here: https://www.microsoft.com/en-gb/download/details.aspx?id=48145. Now I can execute wires.exe from the command line however if I run it as part of Selenium I get 'System.InvalidOperationException : entity not found' – johnstaveley Jun 14 '16 at 12:47
  • Did you have any luck getting this to work with Selenium John? – Daniel Wainwright Jun 15 '16 at 09:58
  • Hi Daniel, it seems that this is a well known problem:http://stackoverflow.com/questions/37790417/selenium-firefox-marionette-driver and http://stackoverflow.com/questions/37761080/c-sharp-selenium-2-53-moving-to-marionette-driver-after-firefox-upgrade-to-47. However the solution seems to be a combination of the above and wait till FF vNext comes out: https://github.com/seleniumhq/selenium/issues/2110 (read to bottom) – johnstaveley Jun 15 '16 at 12:08
  • As Gabi has indicated below they have fixed it in the next version of FF, whenever that comes out – johnstaveley Jun 16 '16 at 09:19

1 Answers1

8

Marionette seems to want to use the nightly build of FireFox. Download Geckodriver, rename it to wires.exe, copy to output. This works for me (FireFox 47 and Selenium 2.53.0):

var driverService = FirefoxDriverService.CreateDefaultService();
driverService.FirefoxBinaryPath = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";
driverService.HideCommandPromptWindow = true;
driverService.SuppressInitialDiagnosticInformation = true;

var driver = new FirefoxDriver(driverService, new FirefoxOptions(), TimeSpan.FromSeconds(60));