Handling java script popups(onclick)

hello every one,
I have a problem while “handling popups”.
It is like
1)In my application after a button click a popup is expected and then I
have to handle that popup.
2)I have written popup handler in seperate thread(using autoit).
3)But when I issue a button click my script is hanging at that point and
its not allowing any other thread to execute .
*) I also used click_no_wait but I found it’s not even clicking the
button its going for the next statement

I am using

ruby version

ruby 1.8.7 (2010-06-23 patchlevel 299) [i386-mingw32]

gem version

1.3.7

I also tried it in ruby version
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
Please give some solution .
I think I am missing some thing or there may be problem with ruby
versions.
I am stucked here ,please help me.
/Phani

Phani C. wrote in post #950098:

hello every one,
I have a problem while “handling popups”.
It is like
1)In my application after a button click a popup is expected and then I
have to handle that popup.
2)I have written popup handler in seperate thread(using autoit).

Do you start this thread before issuing the click?

Anyway my first hunch is to use jruby since it has “real” threads (or
maybe 1.9.x…).
-r

The best thing I have found is to start a popup handler script in a sub
process.

popupHandler =
Kernel.open("|"#{RbConfig::CONFIG[“bindir”]}/#{RbConfig::CONFIG[“ruby_install_name”]}.exe"
“PopupHandler.rb” #{$$} “#{@@browserType}” “#{@@baseUrlAddress}”
“#{@@ieVersion}” “#{@@ffVersion}”", “wb”)

the file attached is the popup handler script. (also uses autoit)

I Use this with watir/firewatir

Hi Roger,
Yes I have started popup handler thread before “click”.I have seen that
popup handler handling other normal popups(other than on-click popups).I
think it’s not thread problem.
hanging after button click is expected but I have to use click_no_wait
to make it work so that it doesn’t hang.But click_no_wait is not
working.
I am attaching my code please find it.
/Phani.

Hi Kevin,
I have been using popup handler in a thread( which is almost equal
starting in separate process).Please find my code in the attachment.
/Phani