Re: [wtr-general] Re: file download
now I've changed the setting so that the powerpoint would be opened without file download prompt. now I need to focus on that already opened powerpoint and do some testing through ruby. earlier i was saving the powerpoint ( clicking the save button from that file download prompt) and opening the same ppt as ppt = WIN32OLE.new('PowerPoint.Application') ppt.Visible = true * **doc = ppt.Presentations.Open('C:\Documents and Settings\sinhaa\My Documents\JHEPAT_2010_VOL51_PG845.ppt')* slidecount = doc.Slides.Count puts slidecount but now as ppt already opened so rather than opening the ppt i should be able to directly count the slides on that ppt. i tried with below code but it seems not working. any thoughts??? ppt = WIN32OLE.new('PowerPoint.Application') ppt.Visible = true slidecount = doc.Slides.Count puts slidecount Regards Arihan On Wed, Apr 14, 2010 at 2:11 PM, Jarmo Pertman wrote: > Only workaround i've used so far is that i've used virtual machine so > you can lock your main machine. No other solutions so far > unfortunately. > > Jarmo > > On Apr 13, 5:50 pm, arihan sinha wrote: > > Any solution to this problem. any work around etc. > > > > Regards > > Arihan > > > > > > > > On Fri, Apr 9, 2010 at 4:03 PM, Ethan wrote: > > > When the system is locked, windows doesn't send things like keypresses > and > > > button presses, as far as I've been able to determine. I know of no > > > workaround for this, and would also be quite interested if anybody else > > > knows one. > > > > > On Fri, Apr 9, 2010 at 07:33, arihan sinha < > arihan.si...@googlemail.com>wrote: > > > > >> Hello All, > > > > >> To handle the download prompt I am using the below code as > > > > >> save_dialog = WIN32OLE.new("AutoItX3.Control") > > >> // > > >> /// > > >> $ie.link(:text, "Download images").click_no_wait > > > > >> click_link_text_no_wait("click Link Download images", > "Download > > >> images") > > > > >> save_dialog.WinWait("File Download","",20) > > > > >> save_dialog.WinActivate("File Download") > > > > >> #save_dialog.Send("{TAB}") > > > > >> save_dialog.Send("{Enter}") > > > > >> sleep 10.0 > > > > >> This piece of code is working fine but when the system is locked then > its > > >> not working.. any idea how to handle this.? > > > > >> also in our remote build server when this piece of code is running > and we > > >> just minimise that remote window then it stuck there and not moving > further. > > > > >> Thanks > > > > >> Arihan > > > > >> -- > > >> Before posting, please readhttp://watir.com/support. In short: search > > >> before you ask, be nice. > > > > >> You received this message because you are subscribed to > > >>http://groups.google.com/group/watir-general > > >> To post: watir-general@googlegroups.com > > > > > -- > > > Before posting, please readhttp://watir.com/support. In short: search > > > before you ask, be nice. > > > > > You received this message because you are subscribed to > > >http://groups.google.com/group/watir-general > > > To post: watir-general@googlegroups.com > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > You received this message because you are subscribed to > http://groups.google.com/group/watir-general > To post: watir-general@googlegroups.com > > To unsubscribe, reply using "remove me" as the subject. > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com
Re: [wtr-general] Re: file download
actually in our localhost we have VMware so its fine but when codes go to the build server there is no VMware.. So problem happens there On Wed, Apr 14, 2010 at 2:11 PM, Jarmo Pertman wrote: > Only workaround i've used so far is that i've used virtual machine so > you can lock your main machine. No other solutions so far > unfortunately. > > Jarmo > > On Apr 13, 5:50 pm, arihan sinha wrote: > > Any solution to this problem. any work around etc. > > > > Regards > > Arihan > > > > > > > > On Fri, Apr 9, 2010 at 4:03 PM, Ethan wrote: > > > When the system is locked, windows doesn't send things like keypresses > and > > > button presses, as far as I've been able to determine. I know of no > > > workaround for this, and would also be quite interested if anybody else > > > knows one. > > > > > On Fri, Apr 9, 2010 at 07:33, arihan sinha < > arihan.si...@googlemail.com>wrote: > > > > >> Hello All, > > > > >> To handle the download prompt I am using the below code as > > > > >> save_dialog = WIN32OLE.new("AutoItX3.Control") > > >> // > > >> /// > > >> $ie.link(:text, "Download images").click_no_wait > > > > >> click_link_text_no_wait("click Link Download images", > "Download > > >> images") > > > > >> save_dialog.WinWait("File Download","",20) > > > > >> save_dialog.WinActivate("File Download") > > > > >> #save_dialog.Send("{TAB}") > > > > >> save_dialog.Send("{Enter}") > > > > >> sleep 10.0 > > > > >> This piece of code is working fine but when the system is locked then > its > > >> not working.. any idea how to handle this.? > > > > >> also in our remote build server when this piece of code is running > and we > > >> just minimise that remote window then it stuck there and not moving > further. > > > > >> Thanks > > > > >> Arihan > > > > >> -- > > >> Before posting, please readhttp://watir.com/support. In short: search > > >> before you ask, be nice. > > > > >> You received this message because you are subscribed to > > >>http://groups.google.com/group/watir-general > > >> To post: watir-general@googlegroups.com > > > > > -- > > > Before posting, please readhttp://watir.com/support. In short: search > > > before you ask, be nice. > > > > > You received this message because you are subscribed to > > >http://groups.google.com/group/watir-general > > > To post: watir-general@googlegroups.com > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > You received this message because you are subscribed to > http://groups.google.com/group/watir-general > To post: watir-general@googlegroups.com > > To unsubscribe, reply using "remove me" as the subject. > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com
[wtr-general] Re: file download
Only workaround i've used so far is that i've used virtual machine so you can lock your main machine. No other solutions so far unfortunately. Jarmo On Apr 13, 5:50 pm, arihan sinha wrote: > Any solution to this problem. any work around etc. > > Regards > Arihan > > > > On Fri, Apr 9, 2010 at 4:03 PM, Ethan wrote: > > When the system is locked, windows doesn't send things like keypresses and > > button presses, as far as I've been able to determine. I know of no > > workaround for this, and would also be quite interested if anybody else > > knows one. > > > On Fri, Apr 9, 2010 at 07:33, arihan sinha > > wrote: > > >> Hello All, > > >> To handle the download prompt I am using the below code as > > >> save_dialog = WIN32OLE.new("AutoItX3.Control") > >> // > >> /// > >> $ie.link(:text, "Download images").click_no_wait > > >> click_link_text_no_wait("click Link Download images", "Download > >> images") > > >> save_dialog.WinWait("File Download","",20) > > >> save_dialog.WinActivate("File Download") > > >> #save_dialog.Send("{TAB}") > > >> save_dialog.Send("{Enter}") > > >> sleep 10.0 > > >> This piece of code is working fine but when the system is locked then its > >> not working.. any idea how to handle this.? > > >> also in our remote build server when this piece of code is running and we > >> just minimise that remote window then it stuck there and not moving > >> further. > > >> Thanks > > >> Arihan > > >> -- > >> Before posting, please readhttp://watir.com/support. In short: search > >> before you ask, be nice. > > >> You received this message because you are subscribed to > >>http://groups.google.com/group/watir-general > >> To post: watir-general@googlegroups.com > > > -- > > Before posting, please readhttp://watir.com/support. In short: search > > before you ask, be nice. > > > You received this message because you are subscribed to > >http://groups.google.com/group/watir-general > > To post: watir-general@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using "remove me" as the subject.
Re: [wtr-general] Re: "File Download - Security Warning" popup
You can use the command for TAB & ENTER to focus in run or save button of u r warning window and get it clicked Sent from my iPhone On 26 Jan 2010, at 20:57, orde wrote: I have previously used solution 2 on http://wiki.openqa.org/display/WTR/File+Downloads for downloading files. You'd have to tweak it (e.g. for starters, change "File Download" to "File Download - Security Warning"; change "&Save" to "&Run"), but it should get you going in the right direction. Hope it helps. orde On Jan 25, 4:30 pm, capri wrote: I replaced click with click_no_wait in my code..doesn't seem to work.. just stalls at this point and doesnt proceed further to click the 'Run' button of the file download - security warning window. any thoughts on this? many thanks.. On Jan 23, 6:19 am, Arihan wrote: Pls use clicknowait method .. It would work .. Sent from my iPhone On 22 Jan 2010, at 22:53, capri wrote: Hi, I tried the below code to identify "file download -security warning" message using autoit in my watir script. However it does not seem to work. I am trying to click the 'Run' button of this window. On running the script, it gets struck and doesn't show any errors. Any thoughts,inputs would be highly appreciated. many thanks. Code: - require 'watir' require 'rubygems' require 'win32ole' # to invoke Autoit controls ie=Watir::IE.new autoit=WIN32OLE.new('AutoItX3.Control') ie.goto "http://www.cooliris.com"; ie.link(:html,/return InstallHelper.clickedDownload()/).click r=autoit.WinExists("File Download - Security Warning") puts r res=autoit.WinWait("File Download - Security Warning",'',3) puts res res=autoit.WinActivate("File Download - Security Warning") puts res res=ie.autoit.ControlFocus("File Download - Security Warning","", "&Run") res=ie.autoit.ControlClick("File Download - Security Warning","","&Run") puts res puts "\n" -- You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines:http:// wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/ group/watir-general -- You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -- You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: "File Download - Security Warning" popup
I have previously used solution 2 on http://wiki.openqa.org/display/WTR/File+Downloads for downloading files. You'd have to tweak it (e.g. for starters, change "File Download" to "File Download - Security Warning"; change "&Save" to "&Run"), but it should get you going in the right direction. Hope it helps. orde On Jan 25, 4:30 pm, capri wrote: > I replaced click with click_no_wait in my code..doesn't seem to work.. > just stalls at this point and doesnt proceed further to click the > 'Run' button of the file download - security warning window. any > thoughts on this? > > many thanks.. > > On Jan 23, 6:19 am, Arihan wrote: > > > > > Pls use clicknowait method .. It would work .. > > > Sent from my iPhone > > > On 22 Jan 2010, at 22:53, capri wrote: > > > > Hi, > > > > I tried the below code to identify "file download -security warning" > > > message using autoit in my watir script. However it does not seem to > > > work. I am trying to click the 'Run' button of this window. On > > > running the script, it gets struck and doesn't show any errors. Any > > > thoughts,inputs would be highly appreciated. > > > > many thanks. > > > > Code: > > > - > > > require 'watir' > > > require 'rubygems' > > > require 'win32ole' # to invoke Autoit controls > > > > ie=Watir::IE.new > > > autoit=WIN32OLE.new('AutoItX3.Control') > > > > ie.goto "http://www.cooliris.com"; > > > > ie.link(:html,/return InstallHelper.clickedDownload()/).click > > > > r=autoit.WinExists("File Download - Security Warning") > > > puts r > > > > res=autoit.WinWait("File Download - Security Warning",'',3) > > > puts res > > > res=autoit.WinActivate("File Download - Security Warning") > > > puts res > > > res=ie.autoit.ControlFocus("File Download - Security Warning","", > > > "&Run") > > > res=ie.autoit.ControlClick("File Download - Security > > > Warning","","&Run") > > > puts res > > > puts "\n" > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Watir General" group. > > > To post to this group, send email to watir-general@googlegroups.com > > > Before posting, please read the following > > > guidelines:http://wiki.openqa.org/display/WTR/Support > > > To unsubscribe from this group, send email to > > > watir-general-unsubscr...@googlegroups.com > > > For more options, visit this group > > > athttp://groups.google.com/group/watir-general -- You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: "File Download - Security Warning" popup
I replaced click with click_no_wait in my code..doesn't seem to work.. just stalls at this point and doesnt proceed further to click the 'Run' button of the file download - security warning window. any thoughts on this? many thanks.. On Jan 23, 6:19 am, Arihan wrote: > Pls use clicknowait method .. It would work .. > > Sent from my iPhone > > On 22 Jan 2010, at 22:53, capri wrote: > > > > > Hi, > > > I tried the below code to identify "file download -security warning" > > message using autoit in my watir script. However it does not seem to > > work. I am trying to click the 'Run' button of this window. On > > running the script, it gets struck and doesn't show any errors. Any > > thoughts,inputs would be highly appreciated. > > > many thanks. > > > Code: > > - > > require 'watir' > > require 'rubygems' > > require 'win32ole' # to invoke Autoit controls > > > ie=Watir::IE.new > > autoit=WIN32OLE.new('AutoItX3.Control') > > > ie.goto "http://www.cooliris.com"; > > > ie.link(:html,/return InstallHelper.clickedDownload()/).click > > > r=autoit.WinExists("File Download - Security Warning") > > puts r > > > res=autoit.WinWait("File Download - Security Warning",'',3) > > puts res > > res=autoit.WinActivate("File Download - Security Warning") > > puts res > > res=ie.autoit.ControlFocus("File Download - Security Warning","", > > "&Run") > > res=ie.autoit.ControlClick("File Download - Security > > Warning","","&Run") > > puts res > > puts "\n" > > > -- > > You received this message because you are subscribed to the Google > > Groups "Watir General" group. > > To post to this group, send email to watir-general@googlegroups.com > > Before posting, please read the following > > guidelines:http://wiki.openqa.org/display/WTR/Support > > To unsubscribe from this group, send email to > > watir-general-unsubscr...@googlegroups.com > > For more options, visit this group > > athttp://groups.google.com/group/watir-general -- You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: "File Download - Security Warning" popup
Try click_no_wait instead of click on this line: ie.link(:html,/return InstallHelper.clickedDownload()/).click Also, check out: http://wiki.openqa.org/display/WTR/Basic+Authentication Hope it helps. On Jan 22, 2:53 pm, capri wrote: > Hi, > > I tried the below code to identify "file download -security warning" > message using autoit in my watir script. However it does not seem to > work. I am trying to click the 'Run' button of this window. On > running the script, it gets struck and doesn't show any errors. Any > thoughts,inputs would be highly appreciated. > > many thanks. > > Code: > - > require 'watir' > require 'rubygems' > require 'win32ole' # to invoke Autoit controls > > ie=Watir::IE.new > autoit=WIN32OLE.new('AutoItX3.Control') > > ie.goto "http://www.cooliris.com"; > > ie.link(:html,/return InstallHelper.clickedDownload()/).click > > r=autoit.WinExists("File Download - Security Warning") > puts r > > res=autoit.WinWait("File Download - Security Warning",'',3) > puts res > res=autoit.WinActivate("File Download - Security Warning") > puts res > res=ie.autoit.ControlFocus("File Download - Security Warning","", > "&Run") > res=ie.autoit.ControlClick("File Download - Security > Warning","","&Run") > puts res > puts "\n" -- You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: file download popup handle
On Fri, May 15, 2009 at 8:25 PM, Chuck van der Linden wrote: > reference the FAQ setion on popups > http://wiki.openqa.org/display/WTR/FAQ#FAQ-HowdoIattachtoapopupwindow%3F Actually, a long time ago I have moved everything from this link to http://wiki.openqa.org/display/WTR/Pop+Ups and left only a link to pop ups page in the faq. :) Željko --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: file download popup handle
This is a fairly common request. Suggestions reference the FAQ setion on popups http://wiki.openqa.org/display/WTR/FAQ#FAQ-HowdoIattachtoapopupwindow%3F Seach the group for a phrase such as "file popup" http://groups.google.com/group/watir-general/search?group=watir-general&q=file+popup or review the section in the tutorials that deals with handling popups.. http://wiki.openqa.org/display/WTR/Pop+Ups On May 12, 11:36 am, curious wrote: > Could you please tell me where in my code I change / add the code you > are suggesting?? Would you please update my code with your > suggestion?? > > I am pretty new to WATIR..and I really am not sure what to do with > your suggestion.. Your help will be deeply appreciated. > > Thank you. > > On May 12, 12:32 am, kiran wrote: > > > > > Hi, > > > Use Clik_no_wait instead of click and use threads.its something like > > this > > t=Thread.new{ > > file_download_code} > > > t.join() > > Thnaks, > > kiran. > > > On May 12, 9:36 am, curious wrote: > > > > I put below code in order to automate file download popup.. > > > > ie.button(:name, "Button5").click > > > > . when WATIR reaches above code.. File download popup > > > shows up.. and the code below should handle this popup and save the > > > file to be downloaded.. however, the code is just sitting there.. > > > 'File download' popup shows up.. but it is not going anywhere.. the > > > file download popup just stays on.. and below code is not handling > > > saving the file.. what am I doing wrong?? Could anyone please tell > > > me how I should adjust the code below in order to automate File > > > download process?? thanks. > > > > prompt_message = "Do you want to open or save this file?" > > > window_title = "File Download" > > > save_dialog = WIN32OLE.new("AutoItX3.Control") > > > sleep 1 > > > save_dialog_obtained = save_dialog.WinWaitActive > > > (window_title,prompt_message, 25) > > > save_dialog.ControlFocus(window_title, prompt_message, "&Save") > > > sleep 1 > > > save_dialog.Send("S") > > > save_dialog.ControlClick(window_title, prompt_message, "&Save") > > > save_dialog.WinSetTitle(window_title, prompt_message, "This is > > > ForTesting" ) > > > saveas_dialog_obtained = save_dialog.WinWait("Save As", "Save&in", 5) > > > sleep 1 > > > path = File.dirname(__FILE__).gsub("/" , "\\" )+ "\\" + fileName > > > save_dialog.ControlSend("Save As", "", "Edit1",path) > > > sleep 4 > > > save_dialog.ControlClick("Save As", "Save &in", "&Save") > > > save_fileAlreadyExists = save_dialog.WinWait("Save As", " ", 5) > > > > def save_file(filepath) > > > ai = WIN32OLE.new("AutoItX3.Control") > > > ai.WinWait("File Download", "", 5) > > > ai.ControlFocus("File Download", "", "&Save") > > > sleep 1 > > > ai.ControlClick("File Download", "", "&Save", "left") > > > ai.WinWait("Save As", "", 5) > > > sleep 1 > > > ai.ControlSend("Save As", "", "Edit1",filepath) > > > ai.ControlClick("Save As", "", "&Save", "left") > > > ai.WinWait("Download complete", "", 5) > > > ai.ControlClick("Download complete", "", "Close") > > > end- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: file download popup handle
Could you please tell me where in my code I change / add the code you are suggesting?? Would you please update my code with your suggestion?? I am pretty new to WATIR..and I really am not sure what to do with your suggestion.. Your help will be deeply appreciated. Thank you. On May 12, 12:32 am, kiran wrote: > Hi, > > Use Clik_no_wait instead of click and use threads.its something like > this > t=Thread.new{ > file_download_code} > > t.join() > Thnaks, > kiran. > > On May 12, 9:36 am, curious wrote: > > > > > I put below code in order to automate file download popup.. > > > ie.button(:name, "Button5").click > > > . when WATIR reaches above code.. File download popup > > shows up.. and the code below should handle this popup and save the > > file to be downloaded.. however, the code is just sitting there.. > > 'File download' popup shows up.. but it is not going anywhere.. the > > file download popup just stays on.. and below code is not handling > > saving the file.. what am I doing wrong?? Could anyone please tell > > me how I should adjust the code below in order to automate File > > download process?? thanks. > > > prompt_message = "Do you want to open or save this file?" > > window_title = "File Download" > > save_dialog = WIN32OLE.new("AutoItX3.Control") > > sleep 1 > > save_dialog_obtained = save_dialog.WinWaitActive > > (window_title,prompt_message, 25) > > save_dialog.ControlFocus(window_title, prompt_message, "&Save") > > sleep 1 > > save_dialog.Send("S") > > save_dialog.ControlClick(window_title, prompt_message, "&Save") > > save_dialog.WinSetTitle(window_title, prompt_message, "This is > > ForTesting" ) > > saveas_dialog_obtained = save_dialog.WinWait("Save As", "Save&in", 5) > > sleep 1 > > path = File.dirname(__FILE__).gsub("/" , "\\" )+ "\\" + fileName > > save_dialog.ControlSend("Save As", "", "Edit1",path) > > sleep 4 > > save_dialog.ControlClick("Save As", "Save &in", "&Save") > > save_fileAlreadyExists = save_dialog.WinWait("Save As", " ", 5) > > > def save_file(filepath) > > ai = WIN32OLE.new("AutoItX3.Control") > > ai.WinWait("File Download", "", 5) > > ai.ControlFocus("File Download", "", "&Save") > > sleep 1 > > ai.ControlClick("File Download", "", "&Save", "left") > > ai.WinWait("Save As", "", 5) > > sleep 1 > > ai.ControlSend("Save As", "", "Edit1",filepath) > > ai.ControlClick("Save As", "", "&Save", "left") > > ai.WinWait("Download complete", "", 5) > > ai.ControlClick("Download complete", "", "Close") > > end- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: file download popup handle
Hi, Use Clik_no_wait instead of click and use threads.its something like this t=Thread.new{ file_download_code } t.join() Thnaks, kiran. On May 12, 9:36 am, curious wrote: > I put below code in order to automate file download popup.. > > ie.button(:name, "Button5").click > > . when WATIR reaches above code.. File download popup > shows up.. and the code below should handle this popup and save the > file to be downloaded.. however, the code is just sitting there.. > 'File download' popup shows up.. but it is not going anywhere.. the > file download popup just stays on.. and below code is not handling > saving the file.. what am I doing wrong?? Could anyone please tell > me how I should adjust the code below in order to automate File > download process?? thanks. > > prompt_message = "Do you want to open or save this file?" > window_title = "File Download" > save_dialog = WIN32OLE.new("AutoItX3.Control") > sleep 1 > save_dialog_obtained = save_dialog.WinWaitActive > (window_title,prompt_message, 25) > save_dialog.ControlFocus(window_title, prompt_message, "&Save") > sleep 1 > save_dialog.Send("S") > save_dialog.ControlClick(window_title, prompt_message, "&Save") > save_dialog.WinSetTitle(window_title, prompt_message, "This is > ForTesting" ) > saveas_dialog_obtained = save_dialog.WinWait("Save As", "Save&in", 5) > sleep 1 > path = File.dirname(__FILE__).gsub("/" , "\\" )+ "\\" + fileName > save_dialog.ControlSend("Save As", "", "Edit1",path) > sleep 4 > save_dialog.ControlClick("Save As", "Save &in", "&Save") > save_fileAlreadyExists = save_dialog.WinWait("Save As", " ", 5) > > def save_file(filepath) > ai = WIN32OLE.new("AutoItX3.Control") > ai.WinWait("File Download", "", 5) > ai.ControlFocus("File Download", "", "&Save") > sleep 1 > ai.ControlClick("File Download", "", "&Save", "left") > ai.WinWait("Save As", "", 5) > sleep 1 > ai.ControlSend("Save As", "", "Edit1",filepath) > ai.ControlClick("Save As", "", "&Save", "left") > ai.WinWait("Download complete", "", 5) > ai.ControlClick("Download complete", "", "Close") > end --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---