title: File upload in Selenium WebDriver using Java
body: <p>I am trying to file upload.I have tried this code </p>
  
  <pre><code>driver.findElement(By.id("documents")).click();     
  driver.get("C:"+File.separator+"exp"+File.separator+"tt.docx");
  
  driver.findElement(By.id("page"));
  Actions ac = new Actions(driver); 
  WebElement element = driver.findElement(By.id("page"));                     
  ac.click(element).perform();
  
  Robot r = new Robot(); 
  r.keyPress(KeyEvent.VK_ENTER); 
  r.keyRelease(KeyEvent.VK_ENTER); 
  r.keyPress(KeyEvent.VK_C); 
  r.keyRelease(KeyEvent.VK_C); 
  r.keyPress(KeyEvent.VK_PERIOD); 
  r.keyRelease(KeyEvent.VK_PERIOD); 
  r.keyPress(KeyEvent.VK_J); 
  r.keyRelease(KeyEvent.VK_J); 
  r.keyPress(KeyEvent.VK_P); 
  r.keyRelease(KeyEvent.VK_P); 
  r.keyPress(KeyEvent.VK_G); 
  r.keyRelease(KeyEvent.VK_G); 
  r.keyPress(KeyEvent.VK_ENTER); 
  r.keyRelease(KeyEvent.VK_ENTER);
  </code></pre>
  
  <p>Execution of this code the folder of file was opened but not written(file path) in text box. My input type=file is read only. Can anybody help me?</p>