Webdriver: File Upload

You can do this without injecting JavaScript. You just need to get hold of the form field and type into it. Something like (using the Ruby API):

driver.find_element(:id, 'upload').send_keys('/foo/bar')

Leave a Comment