开发者

Selenium and Uploadify

开发者 https://www.devze.com 2023-04-04 10:44 出处:网络
Is there any way to usefully test an 开发者_运维问答Uploadify file upload with Selenium?I\'m using Capybara with Rails, but really, any solution with Selenium would be a starting place.I\'m worried I

Is there any way to usefully test an 开发者_运维问答Uploadify file upload with Selenium? I'm using Capybara with Rails, but really, any solution with Selenium would be a starting place. I'm worried I may have to disable Uploadify for Selenium testing.


I was able to get this to work, by interacting with the JS directly. I added this to my test helper.

def upload_via_uploadify file_input_id, path
  page.execute_script("$('##{file_input_id}').show()")
  attach_file(file_input_id, path)
  page.execute_script("$('##{file_input_id}').uploadifyUpload()")
end

You can't actually trigger a button click because of the flash, but besides that it works great and you can test the rest of the interaction goes as planned


Look at Flash-selenium project. But it uses JS so you possibly could do interactions with Flash by yourself using JS.

0

精彩评论

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