title: How to configure Geckodriver for Seleniumhq plugin for Jenkins
body: <p>I am currently working on configuring Jenkins to run selenium tests.</p>
  
  <p>I am using <a href="https://wiki.jenkins-ci.org/display/JENKINS/Seleniumhq+Plugin" rel="nofollow noreferrer">Seleniumhq plugin</a> and the <a href="http://www.seleniumhq.org/download/" rel="nofollow noreferrer">Selenium HTML runner</a> in the Selenium RC slot in the Jenkins configuration*.  </p>
  
  <p>In the particular job, I have a shell script running <code>export PATH=$PATH:/path/to/geckodriver.exe</code> to add it to the path followed by the SeleniumHQ htmlSuite Run step. </p>
  
  <p>When it runs with this configuration, the job fails with the following errors message:</p>
  
  <pre><code> Started by timer
  Building in workspace /var/lib/jenkins/jobs/MYJOB-selenium-ide-test/workspace
  [workspace] $ /bin/sh -xe /tmp/hudson2672803749243149546.sh
  + export PATH=/var/lib/jenkins/tools/hudson.model.JDK/Oracle_8u45/bin:/var/lib/jenkins/tools/hudson.model.JDK/Oracle_8u45/bin:/var/lib/jenkins/.rvm/gems/ruby-2.2.2/bin:/var/lib/jenkins/.rvm/gems/ruby-2.2.2@global/bin:/var/lib/jenkins/.rvm/rubies/ruby-2.2.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/var/lib/jenkins/.rvm/bin:/path/to/geckodriver.exe
   java -jar /var/lib/jenkins/users/me/selenium-html-runner-3.0.1.jar -htmlSuite *firefox example.com /var/lib/jenkins/jobs/MYJOB-selenium-ide-test/workspace/suite1/JenkinsTestSuite /var/lib/jenkins/jobs/MYJOB-selenium-ide-test/workspace/result.html
  [workspace] $ java -jar /var/lib/jenkins/users/ME/selenium-html-runner-3.0.1.jar -htmlSuite *firefox example.com /var/lib/jenkins/jobs/myjob-selenium-ide-test/workspace/suite1/JenkinsTestSuite /var/lib/jenkins/jobs/MYJOB-selenium-ide-test/workspace/result.html
  Multi-window mode is longer used as an option and will be ignored.
  Dec 14, 2016 6:31:00 PM org.openqa.selenium.server.htmlrunner.HTMLLauncher mainInt
  WARNING: Test of browser failed: *firefox
  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
      at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
      at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
      at org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriverService.java:37)
      at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:95)
      at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
      at org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(FirefoxDriver.java:277)
      at org.openqa.selenium.firefox.FirefoxDriver.&lt;init&gt;(FirefoxDriver.java:247)
      at org.openqa.selenium.firefox.FirefoxDriver.&lt;init&gt;(FirefoxDriver.java:242)
      at org.openqa.selenium.firefox.FirefoxDriver.&lt;init&gt;(FirefoxDriver.java:135)
      at org.openqa.selenium.server.htmlrunner.HTMLLauncher.createDriver(HTMLLauncher.java:285)
      at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:107)
      at org.openqa.selenium.server.htmlrunner.HTMLLauncher.mainInt(HTMLLauncher.java:245)
      at org.openqa.selenium.server.htmlrunner.HTMLLauncher.main(HTMLLauncher.java:273)
  
  Publishing Selenium report...
  ERROR: Test reports were found but none of them are new. Did tests run? 
  For example, /var/lib/jenkins/jobs/myjob-selenium-ide-test/workspace/suite1/results.html is 7 days 1 hr old
  
  Build step 'Publish Selenium Report' changed build result to FAILURE
  Finished: FAILURE
  </code></pre>
  
  <p>I can see that the issue is that the line <code>System.setProperty("webdriver.gecko.driver","path/to/geckodriver.exe");</code> needs to be run. How do I properly configure this to happen? (I have tried to have it run as a Groovy build step, but this failed).</p>
  
  <p>*(I have also attempted replacing it with an older version of the standalone server) </p>