1

While executing a project I am getting error. as below 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

I downloaded the application as well but not able to understand how to configure in Intellij so that I should not get this error .

Madhumita
  • 21
  • 2
  • 8
  • 1
    Possible duplicate of [Fail to Launch Mozilla with selenium](http://stackoverflow.com/questions/38676719/fail-to-launch-mozilla-with-selenium) – Saurabh Gaur Sep 17 '16 at 13:17

1 Answers1

0
def userDir = System.getProperty("user.dir").minus("workspace\\selenium-groovy");
System.setProperty("webdriver.gecko.driver", userDir+"/.m2/repository/webdriver/geckodriver/win64/0.11.1/geckodriver.exe")

Change to the correct path of your geckodriver binary. Works for me in IntelliJ Maven build and repository dependencies.

Marek Skiba
  • 2,124
  • 1
  • 28
  • 31