Try this instead:
def startClicker( button , waitTime= 9, user_input=nil )
#get a handle if one exists
hwnd = $ie.enabled_popup(waitTime)
if (hwnd)
w = WinClicker.new
if ( user_input )
w.setTextValueForFileNameField( hwnd, "{user_input}" )
end

w.clickWindowsButton_hwnd( hwnd, "#{button}" )
w=nil
end
end

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



Charley Baker
blog: http://charleybakersblog.blogspot.com/
Project Manager, Watir, http://wtr.rubyforge.org
QA Architect, Gap Inc Direct


On Sun, Jan 4, 2009 at 10:07 PM, Jagdeep Jain <jagdeep.j...@gmail.com>wrote:

>
> Hi,
> The problem with the code below 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 to the next page.
> Anyone please help here.
>
> Thanks,
> Jagdeep
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to