Tags: case, clarification, clicked, dialog, fails, handle, handler, ithink, javascript, jspopup_dialog, link, popup, popupwhen, programming, regarding, ruby, second, supports, watir, winclicker

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

On Programmer » Ruby

1,483 words with 0 Comments; publish: Sun, 27 Apr 2008 21:42:00 GMT; (20054.69, « »)

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'

.ruby.todaysummary.com.ie = Watir::IE.new

.ruby.todaysummary.com.ie.goto("C:/test.html")

.ruby.todaysummary.com.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="/app/links/?link=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>

All Comments

Leave a comment...

  • 0 Comments