Exception in thread “main” java.lang.IllegalStateException: The driver executable does not exist while running Selenium Test on Ubuntu

As you are using Linux based System while specifying the absolute path of the GeckoDriver you have to trim the extension part i.e. .exe part as follows :

System.setProperty("webdriver.gecko.driver", "/root/Desktop/jarselenium/geckodriver");

Update

As you are still seeing the error ensure that :

  1. GeckoDriver is present in the specified location.
  2. GeckoDriver is having executable permission for non-root users. (chmod 777)
  3. Execute your @Test as a non-root user.

Leave a Comment