Forum: Ruby Watir Javascript popup handler: How to handle the popup dial

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2ddcfbeba75b8f7bdc7ac359b3bde26a?d=identicon&s=25 Rajesh (Guest)
on 2007-07-31 06:40
(Received via mailing list)
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>
81b5e41ae80dc7f1aa57d2bf40e7e7d0?d=identicon&s=25 Shawn Anderson (Guest)
on 2007-08-06 20:51
(Received via mailing list)
Rajesh,
There is some good info here in the FAQ about js popups:
http://wiki.openqa.org/display/WTR/FAQ

Also, just a note: keep in mind that doing a "click" in watir equates to
a
click and wait.  therefore your current thread is waiting for IE to come
back.  Hope this helps, and if you need more help, please post your
"popup
handling" code.  It will help to diagnose your problems.

/Shawn
This topic is locked and can not be replied to.