About Javascript Popups/Dialogue Box

A

Amit

Hi,
I have the following code but the problem here is that I am not able
to move forward to next page which appear after clicking on "OK"
button of Java Script pop up.
HTML is as follows:
I save this file in C: drive as test.html

<html> <head> <script type="text/javascript"> function disp_alert()
{ alert("I am an alert box!!"); } </script> <title> Jagdeep </title>
</
head>
<body> <a href= "http://www.google.com" onclick="disp_alert()" />
Click Here </a> </body>
</html>

Watir Script is as follows:

require 'watir'
require 'watir/ie'
require 'watir/contrib/enabled_popup'
#require 'win32ole'

def startClicker( button , waitTime = 10)
w = WinClicker.new
longName = $ie.dir.gsub("/" , "\\" )
shortName = w.getShortFileName(longName)
c = "start rubyw #{shortName }\\watir\\clickJSDialog.rb#{button} #
{waitTime}"
puts "Starting #{c}"
w.winsystem(c)
w=nil
end

$ie = Watir::IE.new
$ie.goto('C:/test.html/')
startClicker("OK")
$ie.link:)text, 'Click Here').click_no_wait

Here is the code which does not shows any exception but it is also not
moving forward
Anyone please help here.

Thanks,
Amit
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top