I'm getting erros when running my JAVA webdriver code. It's to do with the ChromeDriver

好久不见. 提交于 2019-12-20 07:54:01

问题


When I try and run the following code I get errors to do with ChromeDriver.

I'm new to this but I can see that the code gets as far as row 11 but then it fails.

Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: C:\Matts Learning\ChromeDriver\ChromeDriver at com.google.common.base.Preconditions.checkState(Preconditions.java:199) at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:121) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:116) at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32) at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296) at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:116) at TestTiscaliLogin.main(TestTiscaliLogin.java:13)


回答1:


Download latest version of Chrome Driver from here -> Under Downloads.

Download the zip file and extract the contents. The contents will have the exe which you need to use. You can also set it by using -

System.setProperty("webdriver.chrome.driver", "C:://you_path_for_exe//chromedriver.exe");


来源:https://stackoverflow.com/questions/39571183/im-getting-erros-when-running-my-java-webdriver-code-its-to-do-with-the-chrom

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!