4

I am running tests on selenium grid using nunit C# with:

  • selenium-standalone-server: v3.3.1
  • selenium webdriver: v3.3
  • geckodriver: 0.15
  • firefox: v52

Firefox is not installed on the default location and so I get following exception on running tests:

Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line (WARNING: The server did not provide any stacktrace information)

I want to specify Firefox executable path on the capabilities section of node.config file of selenium grid. How do I do that with new geckodriver?

firefox_binary is now obsolete and it uses "moz:firefoxOptions", but I don't know how to specify it in selenium node's config file.

This is what I am doing in the config file, but it's not working:

{
  "capabilities":
  [
    {
      "platform": "WINDOWS",
      "browserName": "firefox",
      "moz:firefoxOptions": {
        "binary": "D:\\Browsers\\Mozilla Firefox\\firefox.exe"
        },
      "maxInstances": 1,
      "seleniumProtocol": "WebDriver"
    }
  ]
.........
3

Unfortunatelly I found only workaround solution (e.g. if you need several different Firefox versions on a single station):

nodeConfig_1.json

{
  "capabilities": [
    {
      "browserName": "firefox",
      "version": "51",
      "platform": "WINDOWS",
      "maxInstances": 1,
      "marionette":true,
      "cleanSession": true
    },
...

gridNode_1.cmd

set "PATH=%PATH%;C:\Program Files\Mozilla Firefox\51" 
java -jar -Dwebdriver.gecko.driver=C:\Apps\Selenium\Grid\drivers\geckodriver.exe selenium-server-standalone-3.3.1.jar -role node -nodeConfig nodeConfig_1.json

As you can guess, for other Firefox binaries you can use simmilar .cmd scripts.

  • Thanks. I am using the same solution. I could not find any documentation online on how to utilize .config file for this. – H.D. Jun 26 '18 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.