错误,线程“主”中的异常java.lang.IllegalStateException:打开Chrome浏览器

时间:2018-12-09 00:32:19

标签: java selenium illegalstateexception

我遇到此错误:

Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: C:\SeleniumProject\chromedriver.exe

我知道我的问题与日食有关  Inside my Package Explorer

这是我在“测试”下使用的测试脚本

package test;

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

public class PleaseWork {


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

        System.setProperty("webdriver.chrome.driver","C:\\SeleniumProject\\chromedriver.exe");

        WebDriver driver = new ChromeDriver();

        driver.get("https://google.com");

        driver.manage().window().maximize();

        Thread.sleep(5000);

        //close
        driver.close();

    }

}

0 个答案:

没有答案