0

My code is very simple code:

 package Automation;

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

public class FirstTestCase {

    public static void main(String[] args) {
        // TODO Auto-generated method stub

        System.setProperty("webdriver.chrome.driver","/Users/Jagman/Downloads/chromedriver");
        WebDriver wd = new ChromeDriver();

        String url = ("https://www.google.com/");

        wd.get(url);

have downloaded and added jar as "Java 3.13.0" from selenium hq site. Download Google Chrome Driver-2.29 from the same website and located it in "/Users/Jagman/Downloads/chromedriver" path.

When I run the above code I getting an error as " java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html at com.google.common.base.Preconditions.checkState(Preconditions.java:738)".

Getting version error though did proper configuration. so kindly help me for fixing the issue. Details: OS: Mac.

demouser123
  • 4,108
  • 9
  • 50
  • 82
Jagman
  • 11
  • 1
    Possible duplicate of [Error message: "'chromedriver' executable needs to be available in the path"](https://stackoverflow.com/questions/29858752/error-message-chromedriver-executable-needs-to-be-available-in-the-path) – demouser123 Aug 05 '18 at 20:47
  • 1
    check at https://stackoverflow.com/questions/51607304/java-lang-illegalstateexception-the-driver-executable-does-not-exist-while-try/51608734#51608734 – irfan Aug 05 '18 at 21:05

1 Answers1

0

add .exe in chromedriver path :

System.setProperty("webdriver.chrome.driver","/Users/Jagman/Downloads/chromedriver.exe");
dangi13
  • 1,275
  • 1
  • 8
  • 11