Selenium using Java - The path to the driver executable must be set by the webdriver.gecko.driver system property

前端 未结 6 1088
清酒与你
清酒与你 2020-11-22 05:01

I am trying to launch Mozilla but still I am getting this error:

Exception in thread \"main\" java.lang.IllegalStateException: The path to the driver

6条回答
  •  滥情空心
    2020-11-22 05:18

    I use from selenium-java-3.141.59 in windows 10 and solved my problem with this code:

    System.setProperty("webdriver.gecko.driver", "C:\\gecko\\geckodriver.exe");
    System.setProperty("webdriver.firefox.bin","C:\\Program Files\\Mozilla Firefox\\firefox.exe");
    WebDriver driver = new FirefoxDriver();
    

提交回复
热议问题