java.lang.IllegalStateException:驱动程序可执行文件在浏览器中不存在

时间:2018-10-25 11:05:39

标签: java selenium

  

线程“ main”中的异常java.lang.IllegalStateException:驱动程序   可执行文件不存在:   C:\ Users \ Administrator \ eclipse-workspace \ ttt \‪C:\ Users \ Administrator \ eclipse-workspace \ ttt \ IEDriverServer.exe     在   com.google.common.base.Preconditions.checkState(Preconditions.java:585)     在   org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:137)     在   org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:132)     在   org.openqa.selenium.ie.InternetExplorerDriverService.access $ 000(InternetExplorerDriverService.java:35)     在   org.openqa.selenium.ie.InternetExplorerDriverService $ Builder.findDefaultExecutable(InternetExplorerDriverService.java:188)     在   org.openqa.selenium.remote.service.DriverService $ Builder.build(DriverService.java:346)     在   org.openqa.selenium.ie.InternetExplorerDriver.setupService(InternetExplorerDriver.java:281)     在   org.openqa.selenium.ie.InternetExplorerDriver。(InternetExplorerDriver.java:211)     在   org.openqa.selenium.ie.InternetExplorerDriver。(InternetExplorerDriver.java:150)     在t.test.main(test.java:16)

public class test {

static WebDriver d;

public static void main(String[] args)
{

    System.setProperty("webdriver.ie.driver","‪C:\\Users\\Administrator\\eclipse-workspace\\ttt\\IEDriverServer.exe");


    d=new InternetExplorerDriver();
    d.get("https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/6511");

}}

1 个答案:

答案 0 :(得分:0)

您只需将System.setProperty设置为;

System.setProperty("webdriver.ie.driver","IEDriverServer.exe");