驱动程序可执行文件不存在

时间:2019-10-22 12:57:08

标签: java selenium

我收到如下错误消息:

The driver executable does not exist: P:\workspace\portalindia_Automation\Drivers\chromedriver.exe

但是我已经在全局属性中初始化了驱动程序,如下所示:

ChromeDriverPath=C:\\Users\\626461\\git\\portalindia_Automation\\Drivers\\chromedriver.exe

请帮助我解决错误

1 个答案:

答案 0 :(得分:0)

您得到的错误是该位置不存在chromedriver.exe。检查该位置是否存在驱动程序。

根据Chrome版本下载驱动程序

https://chromedriver.storage.googleapis.com/index.html

按如下所示操作:

String ChromeDriverPath="C:\Users\626461\git\portalindia_Automation\Drivers\chromedriver.exe";

System.setProperty("webdriver.chrome.driver",ChromeDriverPath);
WebDriver driver = new ChromeDriver();  
driver.get("https://google.com");