Last modified: 2014-09-28 20:25:49 UTC
Summary: At the moment, it's impossible to write an automated test for multiple files into the same input. Neither Selenium nor Watir support this. However, this is a heavily used feature. So, this bug just a TODO for figuring it out some day, and some notes on why we can't now. Background: If you click on an "add file" button, UploadWizard can accept a single file, or multiple files. Very old browsers only accept single files. The script will add one Upload, with a related UploadWizardUploadInterface object for every file. So a single file input might actually be related to multiple UWUIs on the screen, with an index. How to test this? For security reasons, browsers don't allow scripts to set the contents of file fields. Our testing frameworks[1] have a workaround: it's possible to send keystrokes (sendKeys) to a form input element. While there is no human UI for this, most web browsers will accept keystroke events that "type out" the full path. However, it seems there is no convention for sending multiple file paths to an input this way. The Selenium people have a bug for this issue[2]. [1] right now, Cucumber -> PageObject -> Watir -> Webdriver -> Selenium -> an actual web browser. [2] https://code.google.com/p/selenium/issues/detail?id=2239