具有Java,IntelliJ和Gradle的Selenium-驱动程序可执行文件的路径必须由webdriver.gecko.driver系统属性设置

时间:2018-11-14 14:25:12

标签: java selenium gradle cucumber

我正在尝试运行我的测试(黄瓜,java,intelliJ),但出现了此异常线程:

# Get actual predictions
y_pred = clf.predict(X_test)

# You will need to implement the round function yourself
y_pred_rounded = round(y_pred)

# Call the appropriate scorer
score = r2_score(y_test, y_pred_rounded)

我正在使用Selenium 3.141.5和Mozilla 63.0.1。

我尝试学习这本书:《 Java的黄瓜》 一些说明与当前版本无关,因此我遇到了一些麻烦... 但我希望你能帮助我

这是我的build.gradle:

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

1 个答案:

答案 0 :(得分:1)

System.setProperty(“ webdriver.gecko.driver”,pathToYourFirefoxExecutable);