handling java script popups(onclick)

Discussion in 'Ruby' started by Phani C., Oct 14, 2010.

  1. Phani C.

    Phani C. Guest

    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

    --
    Posted via http://www.ruby-forum.com/.
     
    Phani C., Oct 14, 2010
    #1
    1. Advertising

  2. Phani C.

    Roger Pack Guest

    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

    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Oct 14, 2010
    #2
    1. Advertising

  3. Phani C.

    Kevin D. Guest

    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

    --
    Posted via http://www.ruby-forum.com/.
     
    Kevin D., Oct 14, 2010
    #3
  4. Phani C.

    Phani C. Guest

    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


    --
    Posted via http://www.ruby-forum.com/.
     
    Phani C., Oct 19, 2010
    #4
  5. Phani C.

    Phani C. Guest

    Phani C., Oct 19, 2010
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. evander

    java script for popups

    evander, Aug 19, 2003, in forum: Java
    Replies:
    1
    Views:
    366
    Joona I Palaste
    Aug 19, 2003
  2. Moe Sisko
    Replies:
    1
    Views:
    857
    George
    Aug 4, 2008
  3. bubipoo

    java script for popups

    bubipoo, Aug 19, 2003, in forum: Javascript
    Replies:
    1
    Views:
    87
    Berend de Boer
    Aug 19, 2003
  4. bob
    Replies:
    3
    Views:
    190
  5. Replies:
    2
    Views:
    262
Loading...

Share This Page