0

I am getting this error.

Exception in thread "main" java.lang.IllegalStateException: The driver is not executable: /home/hashconnect/Desktop/Priya bugsheet/selenium/chromedriver.exe

Creating a new folder "Drivers" in that project and changed the location as ".\drivers\chromedriver.exe"

This is my code:

package demo;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class test {

    public static void main(String[] args) throws InterruptedException {
        // TODO Auto-generated method stub
        System.setProperty("webdriver.chrome.driver","/home/hashconnect/Desktop/Priya bugsheet/selenium/chromedriver.exe");
        WebDriver driver = new ChromeDriver();
        driver.manage().window().maximize();
        Thread.sleep(5000);
    }

}

Expected: System should launch the chrome browser

Actual: It showing error message:

Exception in thread "main" java.lang.IllegalStateException: The driver is not executable: /home/hashconnect/Desktop/Priya bugsheet/selenium/chromedriver.exe

James Z
  • 12,209
  • 10
  • 24
  • 44

4 Answers4

0

Go to task manager, close all instance of chrome browser by end task and it should work.

k.prerna
  • 31
  • 1
  • 6
0

One reason could be that the path to the driver executable has got a space in it. A suggestion would be to move the driver to a different path and update the path in your code and retry.

Try doing a "ls -ltr /home/hashconnect/Desktop/Priya bugsheet/selenium/chromedriver.exe"

Or it could be that there might be multiple instances of ChromeDriver already running and they are preventing the spawning of more instances. So the suggestion is to kill all those instances from the TaskManager on Windows or with kill -9 on linux.

0

The Problem is Path which you have given.

Try giving full path

Example: C:/Users//Desktop/...../chromedriver.exe

This will Solve your Problem.

Dry Ran it: java.lang.IllegalStateException: The driver executable does not exist: C:\main\resources\chromedriver.exe

The Above Error occurs if you give invalid path (non relative path)

It Works: C:\Users\SA\test\src\resources\chromedriver.exe

The driver is not executable : this issue might occur if the chromedriver.exe does not have execution permission

Sandeep R
  • 26
  • 2
0

I am not sure how selenium works on Ubuntu. Still, the Set up you have downloaded seems to be for a windows version(.exe). It doesn't work on Linux.

Please download the chrome driver for Linux from the below link

Download Chrome Driver for Linux

Reference: Reference link

Ranjith V
  • 39
  • 4