Im new to Mac OSX. Downloaded my Robotframework(Selenium & Java) project from git and tried to execute the code locally wherein I received the below error.
Suite setup failed: IllegalStateException: The driver is not executable: /Users/roja/Documents/GitHub/testautomation/chromedrivers/chromedriver_osx
To rectify this issue, I followed the below but it didnt work.
- Upgraded the selenium-java and standalone version from 2.53.1 to 3.4.0.
- Driver path specified to Users/roja/automation
- Chromedriver upgraded from 2.31 to 2.33
- And the same driver version updated even in the path specified in the exception above.
Also Im unsure why the path is defaulted to /Users/roja/Documents/GitHub/testautomation/chromedrivers/chromedriver_osx
.
My git projects are saved in the path usr/local/git/testautomation and chromedriver also saved in the same. please clarify and provide me a solution.
Below code written for launching the browser,
public void LaunchBrowser() throws InterruptedException {
System.setProperty("Webdriver.chrome.driver", "/Users/roja/Automation/chromedriver_osx");
driver = new ChromeDriver();
driver.manage().window().maximize();
}
To install the latest version of ChromeDriver:
Mac users with Homebrew:
brew tap homebrew/cask && brew cask install chromedriver
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With