Here is the situation. I downloaded the chrome webdriver, unzipped the file, and went through the steps for setting the path through system properties. I am still unable to open chrome from Eclipse. Please help.
Asked
Active
Viewed 152 times
1 Answers
2
You are giving wrong parameter in system properties
Gecko driver is for firefox
If you have already downloaded chrome driver simply replace geckodriver.exe with chromedriver.exe.Otherwise, Download chrome driver and place it in your folder given in system properties and run your code.
Your code will appear as:
System.setProperty("webdriver.chrome.driver", "C:\\Users\\...\\Drivers\\chromedriver.exe"); // **Note**: complete your path above driver = new ChromeDriver();

undetected Selenium
- 183,867
- 41
- 278
- 352

Waqar Nadir
- 378
- 2
- 9
-
Thanks! It worked. Now, one more question. I tried setting the system variable for chromedriver so that I wouldn't have to write out that whole thing (System.setProperty etc.). When I did that and commented the phrase out, I got the executable path error. It works fine with FF but not so much with Chrome. What should I do? – A-L Feb 27 '19 at 13:48
-
Add path of folder containing chromedriver.exe i.e "D:path\to\" in environment variable(environment variables > system variables > path). restart your eclipse. It will pick chromedriver https://developers.thomsonreuters.com/sites/default/files/How%20To%20Add%20ChromeDriver%20To%20System%20Variables_0.pdf – Waqar Nadir Mar 01 '19 at 06:24
-
I appreciate the help. I got it to work by making it a user variable instead of a system's variable. Not sure why it worked out this way but it did. If you guys have any ideas as to why it worked out this way versus making it a system's variable, feel free to share. – A-L Mar 01 '19 at 22:35