I'm using windows on my system. I downloaded and extracted the chromedriver.exe file and I added it to my path.
Here is my code:
package com.chrometester.webdriver;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class chromeTest {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Tgagn_000\\Desktop\\selenium\\chrome");
WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com");
}
}
But it comes back with an error:
Exception in thread "main" java.lang.IllegalStateException: The driver executable is a directory: C:\Users\Tgagn_000\Desktop\selenium\chrome