Reputation: 203
I've tried setting the chromedriver permission and flagging it as executable. I set the PATH variable as well but still get this error. What other steps can I take to troubleshoot the issue? I'm running Jenkins with Git on an EC2 Linux instance.
java.lang.IllegalStateException: The driver is not executable: /var/lib/jenkins/workspace/Selenium TestNG ANT Build - Git/chromedriver.exe
at com.google.common.base.Preconditions.checkState(Preconditions.java:534)
at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:140)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:131)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:339)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)
at WebDriver.TestNGScript.beforeTestsetUp(Unknown Source)
... Removed 22 stack frames
Upvotes: 1
Views: 5922
Reputation: 1463
The chromedriver.exe is a Windows executable, not for Linux. Download the Linux version and try again.
If you still get the error after downloading the Linux version of chromedriver, use terminal / bash to navigate to the directory containing the driver and type:
chmod +x chromedriver
Upvotes: 5