Gecko driver path issue with nightwatch.json. The path to the driver executable must be set

916 views
Skip to first unread message

JOBY CHACKO

unread,
Oct 15, 2016, 9:07:48 AM10/15/16
to NightwatchJs
Hi, I get following error when I run nightwatch.

I have started selenium server manually and I can see the same error in the standalone server console also.

Is it something wrong with the path of the gecko driver. I placed the geckodriver.exe in the lib folder inside the project.

My nightwatch.json also placed below. Please have look at the gecko path.

I will be pleased if you help to solve the issue by looking at the nightwatch.json code.



Error Follows

`Error retrieving a new session from the selenium server

Connection refused! Is selenium server started?
{ sessionId: null,
  status: 13,
  state: 'unhandled error',
  value:
   { message: 'The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/jgraham/wires. The latest version can be downloaded from https://github.com/jgraham/wires',
     suppressed: [],
     localizedMessage: 'The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/jgraham/wires. The latest version can be downloaded from https://github.com/jgraham/wires',
     cause: null,
     class: 'java.lang.IllegalStateException',
     hCode: 1379553171,
     screen: null },
  class: 'org.openqa.selenium.remote.Response',
  hCode: 1916691985 }
`


nightwatch.json follows

`{
  "src_folders" : ["tests"],
  "output_folder" : "reports",
  "custom_commands_path" : "",
  "custom_assertions_path" : "",
  "page_objects_path" : "",
  "globals_path" : "",

  "selenium" : {
    "start_process" : false,
    "server_path" : "lib/selenium-server-standalone-2.50.0.jar",
    "log_path" : "",
    "host" : "127.0.0.1",
    "port" : 4444,
    "cli_args" : {
         "webdriver.gecko.driver" : "lib/geckodriver",
      "webdriver.chrome.driver" : "",
      "webdriver.ie.driver" : ""
    }
  },

  "test_settings" : {
    "default" : {
      "launch_url" : "http://localhost",
      "selenium_port"  : 4444,
      "selenium_host"  : "localhost",
      "silent": true,
      "screenshots" : {
        "enabled" : false,
        "path" : ""
      },
      "desiredCapabilities": {
        "browserName": "firefox",
        "marionette": true,
        "javascriptEnabled": true,
        "acceptSslCerts": true
      }
    },
    "chrome" : {
      "desiredCapabilities": {
        "browserName": "chrome",
        "javascriptEnabled": true,
        "acceptSslCerts": true
      }
    }
  }
}
`

Sample code highly appreciated. Please help to configure with firefox


Sanja p

unread,
Oct 15, 2016, 4:39:58 PM10/15/16
to nightw...@googlegroups.com
I always put .exe when refereeing the path to the driver. Haven't try otherwise. Maybe you can try to put .exe  in the path

--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs+unsubscribe@googlegroups.com.
To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/3d4a31dc-abb7-4402-a7c3-454c3bbc1353%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

JOBY CHACKO

unread,
Oct 16, 2016, 1:06:27 AM10/16/16
to NightwatchJs
I tried and it was not working as I remember. But, will try again. Do you think is there any problem with path of geckodriver exe? Relative path. Thanks for the reply.

JOBY CHACKO

unread,
Oct 16, 2016, 1:06:28 AM10/16/16
to NightwatchJs

Dan Caseley

unread,
Oct 16, 2016, 3:01:40 AM10/16/16
to NightwatchJs
My relative paths are all done as folder\\subfolder\\binary
Maybe try switching to that format?

JOBY CHACKO

unread,
Oct 17, 2016, 1:17:15 AM10/17/16
to NightwatchJs
It worked when I give the exact absolute path for the geckodriver.
Thanks for your inputs
Reply all
Reply to author
Forward
0 new messages