运行报错了

来源:6-1 常见浏览器的启动

慕侠941210

2018-09-25 11:29

Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
 at com.google.common.base.Preconditions.checkState(Preconditions.java:847)
 at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:125)
 at org.openqa.selenium.firefox.GeckoDriverService.access$100(GeckoDriverService.java:43)
 at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:168)
 at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:346)
 at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:168)
 at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
 at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:103)
 at com.seleniumTest.driverTest.main(driverTest.java:15)

写回答 关注

1回答

  • annieChen
    2018-09-28 12:02:57

    driver的路径没有设置对吗,

    慕侠9412...

    下载了geckodriver就不报这个错了,现在报这个错了Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to find a matching set of capabilities

    2018-09-29 09:53:49

    共 1 条回复 >

自动化测试之selenium工具使用

web自动化测试selenium从0基础开始。

51928 学习 · 192 问题

查看课程

相似问题