title: Python: actually accessible file upload in splinter?
body: <p>I have a web application that lets the user upload an XML-style file and then modify it in the browser. </p>
  
  <p>I am trying to test the scenario with splinter. Provided I have the correct input (<code>id="form-widgets-body"</code>):</p>
  
  <p><a href="https://i.stack.imgur.com/2qYQ1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2qYQ1.png" alt="enter image description here"></a></p>
  
  <p>...I can find it no problem, as well as use <code>attach_file</code> with its name:</p>
  
  <pre><code>(Pdb)     brwsr.find_by_id('form-widgets-body')
  [&lt;splinter.driver.webdriver.WebDriverElement object at 0x7f2be3a32dd0&gt;]
  </code></pre>
  
  <p><code>brwsr.attach_file('form.widgets.body', PATH_TO_FILE)</code></p>
  
  <p>But the problem with <code>attach_file</code> is that it doesn't actually make the file accessible to me. Maybe it just tells the input that something has been filled in, which is nice for other kinds of tests? (e.g., you can't proceed to next screen in a financial app until you upload Document X)</p>
  
  <p>I tried <code>send_keys</code> instead, but it didn't work as expected:</p>
  
  <pre><code>(Pdb)     brwsr.find_by_id('form-widgets-body').send_keys
  *** AttributeError: 'ElementList' object has no attribute 'send_keys'
  (Pdb)     brwsr.find_by_id('form-widgets-body')[0].send_keys
  *** AttributeError: 'WebDriverElement' object has no attribute 'send_keys'
  </code></pre>
  
  <p>With that said, some questions:</p>
  
  <ol>
  <li><p>Would <code>send_keys</code> actually do what I want (i.e., an accessible file upload that's just like the real thing) ? If so, what is the <em>right</em> way to call it?</p></li>
  <li><p>If not, what else can I do? (requiring js, maybe?)</p></li>
  </ol>