学习selenium时配置的环境是:
selenium 3.7.1
Firefox 57.0
均为较新版本,写TestNG时照旧driver = new FirefoxDriver();
发现报错:
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
根据提示发现需要webdriver.gecko.driver才能正常调起Firefox,遂下载之
链接: