为了账号安全,请及时绑定邮箱和手机立即绑定

在硒中使用壁虎时发生错误

在硒中使用壁虎时发生错误

Cats萌萌 2021-04-09 18:19:00
我是硒自动化的新手,我已经遵循了网站的说明,并且使用了gecko驱动程序,但是它显示以下消息。 64位),Selenium 3.12和gecko驱动程序20.1。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)这是我的代码包装自动化框架;导入org.openqa.selenium.WebDriver; 导入org.openqa.selenium.firefox.FirefoxDriver;公共类userLogin {public static void main(String[] args){    System.setProperty("webdriver.gecko.driver ","E:\\\\Selenium\\\\geckodriver-v0.21.0-win64\\\\geckodriver.exe");    WebDriver driver = new FirefoxDriver();    driver.get("https://www.facebook.com/");}
查看完整描述

1 回答

?
蛊毒传说

TA贡献1895条经验 获得超3个赞

代替它

System.setProperty("webdriver.gecko.driver","E:\\\\Selenium\\\\geckodriver-v0.21.0-win64\\\\geckodriver.exe");

它有额外的空间...


查看完整回答
反对 回复 2021-04-18
  • 1 回答
  • 0 关注
  • 139 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信