Mac OSX - IllegalStateException: The driver is not executable:

Quick installation of the latest ChromeDriver

To install the latest version of ChromeDriver:

  • Mac users with Homebrew:

    brew tap homebrew/cask && brew cask install chromedriver
    

Original answered Nov 15 '17 at 12:04

The error IllegalStateException: The driver is not executable: /Users/roja/Documents/GitHub/testautomation/chromedrivers/chromedriver_osx says it all. You have to make exactly 4 changes as follows :

  • Change Webdriver.chrome.driver as :

    webdriver.chrome.driver
    
  • Change /Users/roja/Automation/chromedriver_osx as we need to include the name of the webdriver binary i.e. chromedriver as a value :

    /Users/roja/Automation/chromedriver_osx/chromedriver
    
  • Change driver = new ChromeDriver(); as :

    WebDriver driver = new ChromeDriver();
    
  • Remove unwanted throws InterruptedException to keep your code short and simple.


FYI I had to do the solution proposed by varunrao321: Navigate to the folder containing chromedriver and run chmod +x chromedriver


I tried giving full permission to the chromedriver and it works fine.

chmod +x chromedriver

or

chmod 777 chromedriver