How to handle popup dialog box

Discussion in 'Ruby' started by Amruta, May 17, 2007.

  1. Amruta

    Amruta Guest

    Hi,
    I'am new to Ruby.Please help me to get this done.
    After clicking on a button a popup dialog box appears on the
    screen.Which is a login page having Username and Password text fields
    and Ok button.I'am not able to get that dialog box and not able to set
    text values.

    ie.button:)id , "Sign In").click
    def enabled_popup(timeout)

    #popup=ie.Dialog("title:Login").text().to_s
    hwnd=ie.enabled_popup(5)
    if(hwnd)
    w=WinClicker.new
    w.makeWindowActive(hwnd)
    w.setTextBoxText(hwnd,"admin")
    w.clickWindowsButton_hwnd(hwnd,"Ok")
    end
    end

    Thanks in advance.

    --
    Posted via http://www.ruby-forum.com/.
     
    Amruta, May 17, 2007
    #1
    1. Advertising

  2. Amruta

    Yt Hu Guest

    Hi Amruta,
    try this function

    def startClicker( button , waitTime = 3)
    w = WinClicker.new
    shortName="C:\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir-1.5.3"
    c = "start ruby #{shortName }\\watir\\clickJSDialog.rb #{button }
    #{waitTime} "
    puts "Starting #{c}"
    w.winsystem(c)
    w=nil
    end

    you just need to change the path of shortName accordingly to point to
    your clickJSDialog.rb file

    good luck


    Amruta wrote:
    > Hi,
    > I'am new to Ruby.Please help me to get this done.
    > After clicking on a button a popup dialog box appears on the
    > screen.Which is a login page having Username and Password text fields
    > and Ok button.I'am not able to get that dialog box and not able to set
    > text values.
    >
    > ie.button:)id , "Sign In").click
    > def enabled_popup(timeout)
    >
    > #popup=ie.Dialog("title:Login").text().to_s
    > hwnd=ie.enabled_popup(5)
    > if(hwnd)
    > w=WinClicker.new
    > w.makeWindowActive(hwnd)
    > w.setTextBoxText(hwnd,"admin")
    > w.clickWindowsButton_hwnd(hwnd,"Ok")
    > end
    > end
    >
    > Thanks in advance.


    --
    Posted via http://www.ruby-forum.com/.
     
    Yt Hu, Sep 10, 2008
    #2
    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. Earl Teigrob
    Replies:
    1
    Views:
    5,848
    Earl Teigrob
    Jun 16, 2004
  2. bienwell
    Replies:
    5
    Views:
    5,207
    bienwell
    Aug 13, 2006
  3. Darrin

    Popup dialog box - confirmations

    Darrin, Sep 29, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    165
    Darrin
    Oct 5, 2004
  4. Rajesh
    Replies:
    0
    Views:
    564
    Rajesh
    Jul 31, 2007
  5. Jens Peter Hansen
    Replies:
    7
    Views:
    547
    Randy Webb
    Jun 19, 2004
Loading...

Share This Page