Notice that I pass in a mac specific chromedriver. But you can change _mac_ to _win_, _linux32_ or _linux64_. There are convenience methods provided by Apache Commons SystemUtils that come bundled with grails you can use to make this code more system specific.

I also set a system property for the chrome driver after it has been downloaded. (line 8).

Now, when I run the tests, it will automatically download chromedriver into the test/drivers directory if it doesn’t exist.

For your reference, a final GebConfig can be found here. The linked project also updates the example to grails 2.2.0.

Similarly, for internet explorer, you would need to use an IE driver, and the download link would look something like this:

Would you guys expect this code to work here in 2016? I can’t seem to get the code to run that loads the driver and sets the system property. Running the tests all fail: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property;