Selenium Nodejs CHROMEDRIVER path
Even after adding the driver path in the System variables it didnt worked.
But by creating & setting own default chrome service, it worked
var webdriver = require('selenium-webdriver');
var chrome = require('selenium-webdriver/chrome');
var path = require('chromedriver').path;
var service = new chrome.ServiceBuilder(path).build();
chrome.setDefaultService(service);
var driver = new webdriver.Builder()
.withCapabilities(webdriver.Capabilities.chrome())
.build();
Ok assuming you are using Windows please try the following steps:
Download the latest version of ChromeDriver from here ChromeDriver
Extract the zip and place the contents somewhere you know where it is for example "C:\Users\UserName\AppData\ChromeDriver"
Go to your Control Panel -> System -> Edit the System Variables. Click on the "environment variables" button.
In the system variables box there will be a variable named "Path" select it and click edit. Copy and paste the path to the containing directory of the chromedriver.exe you downloaded onto the end of the variable value and end it with a semi-colon.
Click ok and again to close environment variables and again to close system properties.
Close and reopen your terminal window.
Run the command again.
I hope this helps - there is a good tutorial here