java如何删除可执行路径错误
我犯了个错误
Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist:
然而,我使用了system.setproperty
命令,但仍然在chrome上出错
你可以在下面搜索框中键入要查询的问题!
我犯了个错误
Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist:
然而,我使用了system.setproperty
命令,但仍然在chrome上出错
# 1 楼答案
您使用的是哪个版本的Selenium Java/独立版本?在Selenium 3.0.1中,必须指定驱动程序的路径。为此,您需要下载Chrome驱动程序并保存在C:\foldername中,然后在Windows中初始化Chrome驱动程序,您需要执行以下操作:
System.setproperty("webdriver.chrome.driver", "C:\\\foldername\\chromedriver.exe"); Webdriver driver=new ChromeDriver ();
如果这对你有帮助,请告诉我