click_no_wait doesn't work when called again

5 views
Skip to first unread message

ayanami

unread,
Oct 21, 2008, 4:09:58 AM10/21/08
to Watir General
I'm using method click_no_wait to solve the file download case.
The problem is that the first time i use click_no_wait to click a link
then a File Download window can be showed.
but after that I do the same thing again then no File Download window
popup.It like nothing has been done.

the script is like:


ie = Watir::IE.new
ie.goto("An URL")
ie.link(:id,XXXX).click_no_wait #here is normal,with the next
sentence I successfully download a file.
file_download_method

ie.link(:id,XXXX).click_no_wait #nothing happened here...and
also no error occured.if I write "ie.link(:id,XXXX).click" instand
then a file download windows will be showed...
file_download_method

Bret Pettichord

unread,
Oct 21, 2008, 2:16:11 PM10/21/08
to watir-...@googlegroups.com
What happens if you add a sleep statement at the location indicated below?

ayanami wrote:
> I'm using method click_no_wait to solve the file download case.
> The problem is that the first time i use click_no_wait to click a link
> then a File Download window can be showed.
> but after that I do the same thing again then no File Download window
> popup.It like nothing has been done.
>
> the script is like:
>
>
> ie = Watir::IE.new
> ie.goto("An URL")
> ie.link(:id,XXXX).click_no_wait #here is normal,with the next
> sentence I successfully download a file.
> file_download_method
>

-> Add sleep here

babylonrei

unread,
Oct 22, 2008, 10:42:20 PM10/22/08
to watir-...@googlegroups.com


2008/10/22 Bret Pettichord <br...@pettichord.com>
i did this ,but have no effect.
i print some infomation to debug the programme,i found that the second click_no_wait has been executed.
but i wonder why i didn't see the FileDownload Dialog?
 
> I'm using method click_no_wait to solve the file download case.
> The problem is that the first time i use click_no_wait to click a link
> then a File Download window can be showed.
> but after that I do the same thing again then no File Download window
> popup.It like nothing  has been done.
>
> the script is like:
>
>
> ie = Watir::IE.new
> ie.goto("An URL")
> ie.link(:id,XXXX).click_no_wait       #here is normal,with the next
> sentence I successfully download a file.
> file_download_method
>

-> Add sleep here
> ie.link(:id,XXXX).click_no_wait       #nothing happened here...and
i add some print ihere and i can see cmd print my infomation

Bret Pettichord

unread,
Oct 23, 2008, 10:36:17 AM10/23/08
to watir-...@googlegroups.com
What happens if you change the second call to "click_no_wait" to call
"click" instead. Do you get an error? What is the error message?

Bret


babylonrei wrote:
>
>
> 2008/10/22 Bret Pettichord <br...@pettichord.com
> <mailto:br...@pettichord.com>>

> *i add some print ihere and i can see cmd print my infomation*

babylonrei

unread,
Oct 23, 2008, 11:49:19 PM10/23/08
to watir-...@googlegroups.com
i've tried.when the second call change to "click",the FileDownloadDialog appeared.
But the method i've made to deal with the FileDownloadDialog won't work,it only works when using "click_no_wait" .
and the programe looks stopped this time.i saw a page with a FileDownloadDialog for a long time.I do not get  any error  .


 
2008/10/23 Bret Pettichord <br...@pettichord.com>

Bret Pettichord

unread,
Oct 24, 2008, 12:09:50 PM10/24/08
to watir-...@googlegroups.com
I understand. The suggestion was made as a way to understand the problem
better, not as a solution. The behavior you describe is correct, but i
was hoping we'd see something else which would give us a clue.

The "click_no_wait" method works by spawning a new process and clicking
the button in that process. The problem with this is that if there is
some kind of error in the click, you won't see any error message,
because the error is occuring in the disposable process.

Bret

babylonrei wrote:
> i've tried.when the second call change to "click",the
> FileDownloadDialog appeared.
> But the method i've made to deal with the FileDownloadDialog won't
> work,it only works when using "click_no_wait" .
> and the programe looks stopped this time.i saw a page with a
> FileDownloadDialog for a long time.I do not get any error .
>
>
>
> 2008/10/23 Bret Pettichord <br...@pettichord.com

> <mailto:br...@pettichord.com>>
>
>
> What happens if you change the second call to "click_no_wait" to call
> "click" instead. Do you get an error? What is the error message?
>
> Bret
>
>
> babylonrei wrote:
> >
> >
> > 2008/10/22 Bret Pettichord <br...@pettichord.com
> <mailto:br...@pettichord.com>

> > <mailto:br...@pettichord.com <mailto:br...@pettichord.com>>>

Reply all
Reply to author
Forward
0 new messages