gpt4 book ai didi

java - 执行 Eclipse (Selenium) 时出现以下错误

转载 作者:行者123 更新时间:2023-12-02 12:54:54 25 4
gpt4 key购买 nike

使用 Firefox 版本(53.0.3(32 位))/Selenium (selenium-java-3.4.0)。

Exception in thread "main" java.lang.IllegalStateException: The driver executable is a directory: F:\Selenium\GecKo
at com.google.common.base.Preconditions.checkState(Preconditions.java:518)
at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:138)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:131)
at org.openqa.selenium.firefox.GeckoDriverService.access$100(GeckoDriverService.java:41)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:115)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:330)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:207)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:108)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:104)
at Login.Login.main(Login.java:13)

最佳答案

在设置系统属性时,我们需要给出驱动程序可执行文件的完整路径。

System.setproperty("webdriver.gecko.driver","F:\\Selenium\\GecKo.exe");

关于java - 执行 Eclipse (Selenium) 时出现以下错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44473350/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com