Hi All,
I am using following script to handle the pop up
but the code is not woking
the code autoit.Send("{Enter}") is not working .it doesnot send the
key strokes properly
please help me in this regard
or please give me some other options to handle the pop up
effectively.currently i am using watir 1.6.2
require 'watir'
require 'win32ole'
require 'watir/dialog'
require 'watir/winClicker'
require 'watir/contrib/enabled_popup'
# MAIN APPLICATION CODE
link = '\\\hcl0203\Release 3\Automated Testing\popups Handling
\Sampl1.html'
ie = Watir::IE.start(link)
ie.button(:value, 'Click').click
def check_for_popups(title, button)
popup=Thread.new {
autoit=WIN32OLE.new('AutoItX3.Control')
ret=autoit.WinWait(title,"",5)
if (ret==1)
autoit.WinActivate(title)
button.downcase!
if button.eql?("ok") || button.eql?("yes") || button.eql?
("continue")
autoit.Send("{Enter}")
else
autoit.Send("{tab}")
autoit.Send("{Enter}")
end
elsif (ret==0)
puts "No popup, please check your code."
end
}
at_exit { Thread.kill(popup) }
end
check_for_popups("", "OK")
--
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/watir-general