title: How to run Selenium WebDriver test cases in Chrome with Maven?
body: <p>I need to create simple autotest using ChromeDriver with Maven.</p>
  
  <p>excerpt from pom.xml:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
      &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
      &lt;version&gt;2.53.1&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>test case:</p>
  
  <pre><code>@BeforeTest
  public void StartBrowser_NavURL() {
      driver = new ChromeDriver();
      driver.manage().window().maximize();
  }
  
  @AfterTest
  public void CloseBrowser() {
      driver.quit();
  }
  
  @Test
  public void testToCompareDoubles() {
      driver.get("http://www.google.com");
  }
  </code></pre>
  
  <p>And after running test executing command</p>
  
  <pre><code>mvn -test
  </code></pre>
  
  <p>I receive the following exception:</p>
  
  <p>java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see <a href="https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver" rel="nofollow noreferrer">https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver</a>. The latest version can be downloaded from <a href="http://chromedriver.storage.googleapis.com/index.html" rel="nofollow noreferrer">http://chromedriver.storage.googleapis.com/index.html</a>
      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.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
      at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
      at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
      at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
      at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:116)
      at com.testTask.GoogleTest.StartBrowser_NavURL(GoogleTest.java:26)
      at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:77)
      at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:110)
      at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:106)
      at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
      at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
      at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
      at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
  ... Removed 23 stack frames</p>
  
  <p>I've read discussion accesible via the link below:
  <a href="https://stackoverflow.com/questions/13724778/how-to-run-selenium-webdriver-test-cases-in-chrome">How to run Selenium WebDriver test cases in Chrome?</a></p>
  
  <p>But I can't download executables on my server. So, it's not an option for me.
  But Maven downloads "selenium-chrome-driver-2.53.1.jar" on the server (which is OK for me).</p>
  
  <p>Is there a way to use dowloaded .jar file instead of executable?</p>
  
  <p>P.S. For this project I use IntelliJ Idea Community Edition and I'm not an expert with it</p>