handling java script popups(onclick)

P

Phani C.

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
 
R

Roger Pack

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
 
K

Kevin D.

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.

I Use this with watir/firewatir
 
P

Phani C.

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.

Attachments:
http://www.ruby-forum.com/attachment/5225/vlan_add.rb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top