title: How to upload a file while running tests in selenium hub
body: <p>I am testing a web application using selenium and as part of the test i need to upload a document. When I click on a button called '<code>filelabel</code>' it opens up a windows-based-pop up when the user can browse to the id and click open and then the doc gets attached. I am using chrome driver. </p>
  
  <p>I have tried 2 approaches</p>
  
  <ol>
  <li><p><code>Autoit</code> :  when i run the test locally, I have created an exe and the test runs successfully. But i need to run the test in selenium hub through a Jenkin build and i do not have permission to run exe. Getting permission denied error</p></li>
  <li><p>Tried the remote file upload using the below code and ended up with <code>'unable to focus element;'</code> exception. I think the control is not being transfered to the window based pop up and hence i am getting this exception</p></li>
  </ol>
  
  <p>//remote upload</p>
  
  <pre><code>driver.findElement(By.name("fileLabel")).click();
  driver.setFileDetector(new LocalFileDetector());
  
  WebElement upload = driver.findElement(By.name("fileLabel"));
  
  logger.logp(Level.INFO, this.getClass().getSimpleName(), "filelabel found", "file label found");
  
  upload.sendKeys("./datafiles/myid.jpg");
  
  logger.logp(Level.INFO, this.getClass().getSimpleName(), "id uploaded", "id uploaded");
  </code></pre>
  
  <ol start="3">
  <li>I have also read about using the robo class. but again it looks like i will have to pass the absolute path. not sure whether it will work in the hub</li>
  </ol>
  
  <p>the file is not getting uploaded. I am looking for a viable solution to get the file uploaded while running the test in selenium hub </p>