title: How to upload file using selenium
body: <p>Below is my selenium code</p>
  
  <pre><code>selenium.type("document.forms['UploadForm'].elements['browse']",file.getAbsolutePath());
  selenium.click("document.forms['UploadForm'].elements['submit']");
  </code></pre>
  
  <p>I have multiple forms,which has multiple browse button with property as "broswe" an d multiple submit buttons with property as submit.Since am uploading file by using the form name where i  need to upload the file,i.e "UploadForm" and need to submit in the same form.</p>
  
  <p>But the problem am facing is with out uploading the file,selenium is hitting submit button.</p>
  
  <p>Below is autoit script</p>
  
  <pre><code>WinWaitActive("Choose File")
  Send("C:\Work\selenium\PMG_SPRINT_AUTOMATION\pmg_automation\block_PTN.csv")   
  Send("{ENTER}")
  </code></pre>
  
  <p>How do i adjust this code in my selenium class as there are multiple selenium buttons</p>
  
  <pre><code>try {
    String[] commands = new String[]{};
    commands = new String[]{"C:\\Program Files\\AutoIt3\\attachDocScript.exe"}; //location of the autoit executable
    Runtime.getRuntime().exec(commands);
         }
    catch (IOException e) {}
  </code></pre>