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

R

Rajesh

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>
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top