title: Can not enter file path in File upload window
body: <p>When I run this code, <strong>file upload</strong> window opens up but the selenium script hangs forever and could not enter <strong>file path</strong> in file upload window.</p>
  
  <p>Please help.</p>
  
  <pre><code>public class ImageUpload {
  
  public static void main(String[] args) throws AWTException, InterruptedException {
      // TODO Auto-generated method stub
      System.setProperty("webdriver.edge.driver", "C:\\Users\\HP\\Downloads\\MicrosoftWebDriver.exe");
      WebDriver driver = new EdgeDriver();
      Robot robot = new Robot(); 
      driver.get("http://bg-dev.eweblife.com/prm/bgbtw/rsvp-signup/apply?record=826");
      driver.findElement(By.linkText("Upload new Photo")).click();
      driver.findElement(By.id("drop-area_field_12059")).click();
      Thread.sleep(5000);
      //driver.switchTo().activeElement();
       StringSelection strSel = new StringSelection("C:/photo1.jpg");
      Toolkit.getDefaultToolkit().getSystemClipboard().setContents(strSel, null);
  
      //Create an object for robot class
  
      //Control key in the keyboard
      //Ctrl+V 
  
      robot.keyPress(KeyEvent.VK_CONTROL);
      robot.keyPress(KeyEvent.VK_V);
      robot.keyRelease(KeyEvent.VK_V);
      robot.keyRelease(KeyEvent.VK_CONTROL); 
  
  
      Thread.sleep(3000);
      robot.keyPress(KeyEvent.VK_ENTER);
      robot.keyRelease(KeyEvent.VK_ENTER);
  
     }
  }
  </code></pre>