I have imported all the jars file to my java project still i’m not getting executed. can you please help me out in this situation

package ssssssss.com;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Tst1 {

public static void main(String[] args) throws InterruptedException {
System.setProperty(“webdriver.chrome.driver”,”C:\\chromedriver_win32″);
WebDriver driver = new ChromeDriver();
driver.get(“https://www.facebook.com”);
System.out.println(“succesfully opened the website www.facebook.com”);
Thread.sleep(1000);
driver.quit();

}

}

 

and the error i’m getting is

Exception in thread “main” java.lang.IllegalStateException: The driver executable is a directory: C:\chromedriver_win32
at com.google.common.base.Preconditions.checkState(Preconditions.java:585)
at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:138)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:131)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:33)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:139)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:335)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:89)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)
at ssssssss.com.Tst1.main(Tst1.java:12)

Add Comment
  • 1 Answer(s)

    Hi,

    “System.setProperty(“webdriver.chrome.driver”,”C:\\chromedriver_win32″);” should be  “System.setProperty(“webdriver.chrome.driver”,”C:\\chromedriver_win32.exe″);”

    You are missing the .exe extension. Download latest chrome.exe for selenium from below link :

    https://chromedriver.storage.googleapis.com/index.html?path=2.40/

     

    Thanks,

    Srujana

     

     

    Default Answered on June 9, 2018.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.