vbscript - how to handle IE Download dialog with VB Script? -
how save file automatically in particular location using vb script ?
or how possible download file particular location in ie without interacting download dialog ?
ultimately need save file in particular location ie automatically.
thanks.
what file dialogs our selenium tests leverage autoit, free scripting tool creates executables interact windows component object model--including file save dialogs.
what make simple script saves file in desired location, compile executable, , in vbscript call program.
here script use downloading excel files, although may bit more complicated need.
winwait("file download", "", 60) winactivate("file download") if winactive("file download") sleep (500) sendkeepactive ("file download") send("!s") winwait("save as") winactivate("save as") sleep (500) sendkeepactive ("save as") if $cmdline[0] > 0 send($cmdline[1]) else send("c:\windows\temp\latestautotestexport.xls") endif send("!s") sleep (500) if winactive("save as") winactivate("save as") sleep (500) sendkeepactive ("save as") send("!y") sleep (15000) endif if winactive("download complete") winclose("download complete") endif winclose("blank page - windows internet explorer") else winactivate("microsoft office excel") if winactive("microsoft office excel") send("y") endif sleep(500) send("{f12}") if $cmdline[0] > 0 send($cmdline[1]) else send("c:\windows\temp\latestautotestexport.xls") endif send("!s") send("y") send("!y") send("!y") sleep(5000) processclose("excel.exe") sleep(5000) winclose("blank page - windows internet explorer provided yahoo!") endif
Comments
Post a Comment