开发者

Capybara attach_file method, via selenium-webdriver, leaves system file upload dialogue open

开发者 https://www.devze.com 2023-04-11 06:12 出处:网络
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.

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:

  1. User is presented with a choice of 3 buttons (to specify type of file to be uploaded)
  2. Selecting any of these immediately triggers file upload to be shown (via js)
  3. 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)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号