title: Can not configure Selenium with Jenkins
body: <p>I'm using the centos 7 &amp; facing issue while integrating selenium with Jenkins.</p>
  
  <p>I've written below selenium script which on my local machine is properly executing.</p>
  
  <p>I've tomcat running on port 8081 and this script is working on it.</p>
  
  <p>The script is below - </p>
  
  <pre><code>public class App 
  {
  
  @Test
  public static void main( String[] args ) throws InterruptedException
  {
      System.setProperty("webdriver.chrome.driver","/home/amrut/Documents/chromedriver"); 
      ChromeOptions chromeOptions = new ChromeOptions(); 
  
  //      chromeOptions.addArguments("--headless");
  
      WebDriver driver = new ChromeDriver(chromeOptions); 
  
      System.out.println("Hi, Welcome to  YouTube Live session on Selenium WebDriver"); 
  
      driver.get("http://localhost:8081/addressbook"); 
      driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
      Thread.sleep(1000);
      driver.findElement(By.className("v-button")).click(); 
      Thread.sleep(1000);
      driver.findElement(By.id("gwt-uid-5")).sendKeys("temp"); 
      Thread.sleep(1000);
      driver.findElement(By.id("gwt-uid-7")).sendKeys("DevOps");
      Thread.sleep(1000);
      driver.findElement(By.id("gwt-uid-9")).sendKeys("9834562709");
      Thread.sleep(1000);
      driver.findElement(By.id("gwt-uid-11")).sendKeys("Devops@temp.co");
      Thread.sleep(1000);
      driver.findElement(By.id("gwt-uid-13")).sendKeys("01/01/2015");
      Thread.sleep(1000);
      driver.findElement(By.className("v-button-primary")).click(); 
      Thread.sleep(3000); 
      driver.quit();    
  
      System.out.println("Done....");
  }
  }
  </code></pre>
  
  <p>Now, if I run this locally through Eclipse, it is working fine.</p>
  
  <p>I've Exported the runnable jar file from this and I've uploaded it to the Git repository.While creating the jar file uncommented the headless chromeoptions line from my code. </p>
  
  <p>Also, this local Jar file is working fine from my local command line.</p>
  
  <p>Now I'm creating the Jenkin's Job which will fetch this GIT repo &amp; in the Build section I've selected the <strong>Execute shell</strong> &amp; passed the below command to it - </p>
  
  <pre><code>java -jar "/var/lib/jenkins/workspace/Selenium Demo/App1_test.jar"
  
  Caused by: java.lang.IllegalStateException: The driver executable does not exist: /home/amrut/Documents/chromedriver
  at com.google.common.base.Preconditions.checkState(Preconditions.java:585)
  at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:136)
  at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:131)
  at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:33)
  at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:139)
  at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:335)
  at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:89)
  at org.openqa.selenium.chrome.ChromeDriver.&lt;init&gt;(ChromeDriver.java:157)
  at com.amrut.SeleniumDemo.App.main(App.java:26)
  ... 5 more
  Build step 'Execute shell' marked build as failure
  Finished: FAILURE
  </code></pre>
  
  <p>I'm pretty sure that my chromedriver exist in the path /home/amrut/Documents/chromedriver
  but not sure why am I getting this error?</p>
  
  <p>Please assist. I tried with lot of options but still not able to fix this.</p>
  
  <p>Thanks in advance.</p>