My Selenium Grid is showing an error:
org.openqa.selenium.WebDriverException: The path to the driver executable must be set by the webdriver.chrome.driver system property;
but I have specified it perfectly (according to my knowledge)
System.out.println("googlechrome");
capability = DesiredCapabilities.chrome();
capability.setBrowserName("chrome");
capability.setPlatform(org.openqa.selenium.Platform.WINDOWS);
System.setProperty("webdriver.chrome.driver", "D:\\testing\\zip file\\chromedriver_win_26.0.1383.0\\chromedriver.exe");
driver = new ChromeDriver();
I don't know what went wrong. This same code worked perfectly last week but now it doesn't.
if you are running the Grid, you need to set up Chromedriver executable in the node:
java -jar selenium-server-standalone-2.31.0.jar -role node -hub http://localhost:4444/grid/register -maxSession 15 -browser browserName="chrome",version=ANY,platform=WINDOWS,maxInstances=15 -Dwebdriver.chrome.driver=lib\chromedriver.exe
the most important part is the -D
switcher which goes right after the chrome browser setup.
also, if you are running more than one nodes, that path must direct to the chromedriver executable on the concrete computer (node). Thats why I have it as relative path and not as a absolute path...
Is this not what you need?
File file = new File("D:\testing\zip file\chromedriver_win_26.0.1383.0\chromedriver.exe");
system.setProperty("webdriver.chrome.driver", file.getAbsolutePath());
driver = new ChromeDriver(capability);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With