8
votes

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

1
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 localhost:49426 - johnstaveley
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: microsoft.com/en-gb/download/details.aspx?id=48145 - johnstaveley
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
Ok, I installed the x86 version (as well) from here: 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
Did you have any luck getting this to work with Selenium John? - Daniel Wainwright

1 Answers

7
votes

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