I'm trying to set up tests for a upload using the plupload queue widget. I'm using Splinter for in-browser test, but I couldn't find a way to make it happen. Splinter has some methods to attach files, but only if it's a simple file field. Another way would be click the button to browse the files, and choose the file... but I don't think it's possible using Splinter (or selenium), is it? Or with drag-n-drop of the files.
Anyone has any suggestion of the best way to automatize theses tests?
I had a similar problem with the PlUpload widget. Thank you to CheryJose for putting me on the right track.
First of all I had to create a small class to find out which windows were open and return them as a dictionary of windows.
In the Selenium page code I click on the button to launch the PlUpload window and put in a short wait. (This is not shown in the code)
Then I use the code below to find all open windows
Switch to the PlUpload window (the name of the window is different across browsers. Be Aware!)
Type in the path for the file
Press Enter
The PlUpload window will close so we switch back to the browser window (in this case Firefox)
There are a couple of issues with this as the window titles are different depending on which browser is being used, so this will need to be taken into account for a complete solution. In addition, when this section of code is executing do not bring any other windows to the foreground as this window will receive the 'SendKeys' rather than the required window.
Its possible to automate user actions done on PLUpload control using Selenium- WebDriver. Please find the WebDriver C# code below, which clicks on a flash button object and selects a file using keyboard events,