So i'm trying to to learn Selenium and encountered a problem. Can't run chromedriver.
Error:
Exception in thread "main" java.lang.IllegalStateException: The driver is not executable: /Users/Roberto/Documents/EclipseProjects/MansPirmaisSelenium/lib/chromedriver
Code:
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")+"//lib//chromedriver");
WebDriver chromeDriver = new ChromeDriver();
chromeDriver.get("http://www.google.lv");
I have my chromedriver in the right path i guess, here is the image.
File permissions for Unix based files can be checked and set via java like:
Check if the file permission allow :
Set the file permission :
I assume you just downloaded the chromedriver application, in which case you simply have to mark it as executable in Unix:
If you can run the application yourself from the terminal, then WebDriver should be able to as well.
By the way, I wouldn't include
chromedriver
inside your project:The problem is exactly in permissions to the chromedriver in the target directory. To solve the problem author mentioned above change your chromedrive initialization to the following:
of course use your own appropriate directory to the file.