Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'selenium'
- require 'test/unit'
- require 'win32ole'
- class DownloadFileTest < Test::Unit::TestCase
- def setup()
- @wsh = WIN32OLE.new('Wscript.Shell')
- end
- def teardown
- WIN32OLE.ole_free(@wsh) # yes, this is required *rolls eyes*
- end
- def test_download_file
- # ...stuff that causes a download window to pop up...
- @wsh.AppActivate("Opening")
- sleep(2)
- @wsh.SendKeys("{RIGHT}{ENTER}") # Hits ok button - file downloads
- sleep(3)
- # Use regular Ruby File methods to assert stuff on the file content
- end
Add Comment
Please, Sign In to add comment