title: Cucumber (Java) and Selenium: where to place driver path using setProperty?
body: <p>I'm building a test suite using Cucumber for Java with Selenium. And my project structure is pretty much like this:</p>
  
  <ul>
  <li>src/test/java: this is where I have my test steps implementation.</li>
  <li>src/test/resources/features: this is where I have feature files.</li>
  <li>src/test/resources/seleniumdrivers: this is where I put chromedriver.exe.</li>
  </ul>
  
  <p>Now, what I did was to add a Hooks.java class in src/test/java with a method that sets up the driver path, using the @Before hook:</p>
  
  <pre><code>@Before
  public void setUpDriver(){
      System.setProperty("webdriver.chrome.driver", "src\\test\\resources\\seleniumdrivers\\chromedriver.exe");
  }
  </code></pre>
  
  <p>However, since this method will run before each scenario, I'd like to find a better way to set up the path, so it's only done once. Please note that I want to have the driver within my project structure and set it using a system property (I mean, I don't want to place the driver somewhere in my filesystem and add it to the PATH environment variable).</p>
  
  <p>Is there a better way to do this?</p>