Capybara attach_file method, via selenium-webdriver, leaves system file upload dialogue open
I have a slightly weird file upload user flow in an application I am testing which causes the file upload dialogue to remain open when testing with selenium-webdriver, via capybara.
The flow is this:
- User is presented with a choice of 3 buttons (to specify type of file to be uploaded)
- Selecting any of these immediately triggers file upload to be shown (via js)
- Choosing file inserts the filename in a hidden field and submits form to the server
The problem is this: I can click the button for step 1, and attach the file for step 3, and all continues as usual. But the system file open dialogue remains open due to step 2, and these accumulate if I'm running several scenarios on the same piece of functionality.
So, although this doesn't break anything, it is obviously a bit untidy potentially having several file up开发者_高级运维load dialogues persisting through the entire test suite.
Have you tried skipping step 1 and 2 and just doing step 3?
Just wondering if that would work (can't say I have tried this before)
精彩评论