I ran into a similar issue and was able to work around it by calling click! instead of click or click_no_wait. We're not using SproutCore so this may not be relevant to your issue.
## snip # Click on the Export button then Save the file as an artifact export = browser.button(:id, "exportButtonId") export.click! popup_save_file artifact_filename ## end snip ## snip def popup_save_file(filename, wait_time = 10) begin autoit = WIN32OLE.new("AutoItX3.Control") # Wait for the "File Download" dialog autoit.WinWaitActive("File Download", "", wait_time) # Click on the Save button autoit.ControlFocus("File Download", "", "&Save") sleep 1 autoit.Send("S") autoit.ControlClick("File Download", "", "&Save") # Wait for the "Save As" dialog, enter the filename and click Save autoit.WinWaitActive("Save As", "", wait_time) autoit.Send(filename) autoit.ControlClick("Save As", "", "&Save") # Wait for the "Download complete" dialog and Close it autoit.WinWaitActive("Download complete") autoit.WinClose("Download complete") rescue @@logger.warn "Error occurred while saving file: #{$!}" end ##end snip Good luck. On Feb 11, 8:11 pm, Bill Xu <xulei8823...@gmail.com> wrote: > Hi > The Thread.new function seems still could not solve the problem. > (click_no_wait still could not work for me, the) > see following simple code: > ####code##### > downloadlink = $ie.link(:text,"SAMPLE.CSV") > thr = Thread.new { > downloadlink.fire_event("onMouseDown") > downloadlink.fire_event("onMouseUp")} > > downloadlink.click_no_wait > save_file("C:\\file.txt") > ####code end##### > Note that the link is chosen but not clicked. > > 2009/2/11 LFIdnl <sraniim...@gmail.com> > > > > > Run you part of code in new thread: > > > thr = Thread.new { > > your_object.fire_event("onMouseDown") > > your_object.fire_event("onMouseUp") > > } > > sleep(5) #Waiting for end of execution of thread > > #continue your test > > > On 26 янв, 23:25, Bill Mosteller <w...@greatdecals.com> wrote: > > > The application situation is that the user is about to discard unsaved > > > work. A dialog box appears titled "Windows Internet Explorer" saying > > > "Are you sure you want to delete the selected Email?" with buttons > > > "OK" and "Cancel". > > > > I thought my prayers were answered for this when I found: > >http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups > > > > While it proposes five solutions to the problem, solutions 3 thorugh 5 > > > require the use of .click_no_wait. I'm testing a SproutCore > > > application, and .click doesn't work, so .click_no_wait doesn't, > > > either. (I'm using .fire_event("onMouseDown") followed by .fire_event > > > ("onMouseUp") to click on things. > > > > So I tried solutions 1 and 2 in the article, and while I got both to > > > execute without errors in my application, neither approach dismisses > > > my modal dialog box. > > > > Thankis. > > > Bill Mosteller > > > Eloqua --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---