Bhavesh
Bhavesh

Reputation: 23

IE Browser using Selenium Webdriver: "The driver executable is a directory"

I am getting the following error while trying to launch an IE browser using Selenium Webdriver. What seems to be the problem?

Exception in thread "main" java.lang.IllegalStateException: The driver executable is a directory: D:\Bhavesh\Bhavesh_Data\Study\Selenium\IEDriverServer_x64_2.45.0
    at com.google.common.base.Preconditions.checkState(Preconditions.java:197)
    at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:119)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:112)
    at org.openqa.selenium.ie.InternetExplorerDriverService.access$1(InternetExplorerDriverService.java:1)
    at org.openqa.selenium.ie.InternetExplorerDriverService$Builder.build(InternetExplorerDriverService.java:247)
    at org.openqa.selenium.ie.InternetExplorerDriver.setupService(InternetExplorerDriver.java:251)
    at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:172)
    at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:146)
    at first.IEDriver.main(IEDriver.java:11)

Upvotes: 2

Views: 16911

Answers (4)

mani s
mani s

Reputation: 1

  1. Add one folder and add all the drivers needed.

  2. Now copy the path of the driver from properties and use it in set property example.

    System.setProperty("webdriver.chrome.driver","C:\\Users\\arumugam\\eclipse-workspace\\FirstTestNG\\driversdirector\\chromedriver.exe");
    

Upvotes: 0

abrakadabrda
abrakadabrda

Reputation: 25

  1. Check path to driver, click on driver by right button in IDE and copy path to folder
  2. Try to change path to something like this (with backslashes):

    System.setProperty("webdriver.chrome.driver", new File("C:\\QA\\neoAutomation\\src\\main\\resources\\drivers\\chromedriver.exe") .getAbsolutePath()); return new ChromeDriver(getCapabilities(browser));

Upvotes: 0

Vikram
Vikram

Reputation: 127

As per my understanding, when you set property for IEDriver location, you did not mentioned the full path (full directory path including iedriver exe)

For example.. Consider the following..

if you placed your IEDriverServer.exe in "D:/IEdriver" , then you have to set the property as follows:-

Right Approach:- System.setProperty("webdriver.ie.driver", "D:/IEdriver/IEDriverServer.exe");

Wrong approach :- System.setProperty("webdriver.ie.driver", "D:/IEdriver");

Let me know if it helps

Upvotes: 7

Vicky
Vicky

Reputation: 3021

I think there might be an issue in setting up the executable property..

Set the executable property as below

 File file = new File("C:/Seleniumjars/IEDriverServer.exe");
  System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
  driver = new InternetExplorerDriver();      
 }

Upvotes: 1

Related Questions