在Webdriver_class.main(Webdriver_class.java:14)上出现错误(在org.openqa.selenium.firefox.FirefoxDriver。<init>(FirefoxDriver.java:125)

时间:2019-10-02 05:40:20

标签: java selenium webdriver

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;



public class Webdriver_class

{

public static void main(String[] args)

{

WebDriver driver = new FirefoxDriver();

driver.get("http://google.com");

System.out.println(driver.getTitle());

driver.close();

}
}

用eclipse iam编写此程序后,出现一些错误。

at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)


at Webdriver_class.main(Webdriver_class.java:14)


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

请为此提供合适的解决方案

0 个答案:

没有答案