title: How to best handle file upload failures in selenium webdriver
body: <p>I am looking for any ideas on how best to handle file upload failures in selenium webdriver. </p>
  
  <p>Recently I have been seeing a higher number of failures in my webdriver test suite, the error I am trying to fix is a failure in the Internet Explorer tests caused by a file upload failing. </p>
  
  <p>In webdriver the only way I know to upload a file to an input element is to use the <code>SendKeys()</code> method and pass the file path to <code>SendKeys()</code> this works like a charm in chrome and firefox but periodically have had issues with it in Internet Explorer. What appears to happen is the file upload window gets opened but the path is not typed nor is the file uploaded. This leaves the node with a file upload window open, being this is a native window's window and not a webpage selenium cannot interact with the pop up. <a href="https://i.stack.imgur.com/ycgpt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ycgpt.png" alt="enter image description here"></a></p>
  
  <p>The result is the <code>HttpWebRequest</code> does not get a response back triggering a WebdriverTimoutException. This results in the session getting cleaned up. This causes a cascade of failures for all other tests in the suite as the session has been terminated. </p>
  
  <p><strong>Environment Info:</strong></p>
  
  <ul>
  <li>Selenium.Webdriver &amp; Seleneium.Support version 3.7.0   </li>
  <li>IEDriver 3.7.0   </li>
  <li>Testing in IE 11</li>
  </ul>