Watir Javascript popup handler: How to handle the popup dialog?

Discussion in 'Ruby' started by Rajesh, Jul 31, 2007.

  1. Rajesh

    Rajesh Guest

    Clarification regarding JSpopup_dialog. Winclicker supports the popup
    when clicked on the link but the same fails in the second case. I
    think Watir is unable to get the handle of the dialog...Any help???
    Application hangs...

    require 'watir'

    @ie = Watir::IE.new
    @ie.goto("C:/test.html")
    @ie.button:)caption, "Click this button").click

    I see that the application hangs up. How do i handle the dialog?
    I need to validate the 'message' and then click on 'OK'

    I tried the methods in WinClicker.rb but could not succeed. It just
    works fine when i do a click_no_wait but that doesn't serve my
    purpose.
    Any suggestions/solution would be greatly appreciated.

    Thanks in advance,
    -- Rajesh.V


    My Application:
    ----------------------
    <html>
    <head>
    <title>Page created for Testing</title></head>

    <script language="Javascript">
    function showAlert()
    { alert("Validation Alert!"); }
    </script>

    <body>
    <h1>Automation Testing</h1>

    <p>This works fine with the existing WinClicker.rb:<br>
    <a href="javascript:showAlert();")'>Click this link</a></p>
    <hr>

    <p>But this doesn't work !!! <br>
    <input type="button" onclick="javascript:showAlert()"
    value="Click this button" />
    <hr>

    <a </body>
    </html>
     
    Rajesh, Jul 31, 2007
    #1
    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,846
    Earl Teigrob
    Jun 16, 2004
  2. Replies:
    3
    Views:
    186
    Dheeraj Gambhir
    Jul 30, 2009
  3. Amruta
    Replies:
    1
    Views:
    142
    Yt Hu
    Sep 10, 2008
  4. Anukul Singhal
    Replies:
    1
    Views:
    168
    Charley Baker
    May 15, 2008
  5. Prince Soni

    Model Dialog - WATIR

    Prince Soni, Mar 16, 2011, in forum: Ruby
    Replies:
    1
    Views:
    131
    Roger Pack
    Mar 23, 2011
Loading...

Share This Page