i am using ruby 1.8.6 and watir 1.6.2 here am using this code to click ok button of the java script popup generated after clicking a button ,but it is not working..it is throwing errors
require'rubygems' require 'watir' require 'watir/ie' require 'watir\contrib\enabled_popup' require 'win32ole' $ie=WATIR::IE.new def check_popups(title,button) Timeout::timeout(2) do begin autoit=WIN32OLE.new('AutoItX3.Control') ret=autoit.WinWait(title,"",60) if (ret==1) @message = "There is popup." @status = "Passed" 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 else if (ret==0) @message ="No popup, please check your code." @status="Failed" end end rescue Timeout::Error @message="No popup found" @status="Failed" end end #timeout(2) end $ie.goto('http://justaddwatir.com/watir/test_html/tc_0101_0200/ test_0107.html') $ie.text_field(:name,"text1").set("This is the text in the popup") $ie.button(:name,"submit").click check_for_popups("Microsoft Internet Explorer", "OK") the errors: >ruby testingpopup2.rb C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/ dependencies.rb:443:in `load_missing_constant': uninitialized constant WATIR (NameError) from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/dependencies.rb:80:in `const_missing' from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/dependencies.rb:92:in `const_missing' from testingpopup2.rb:7 >Exit code: 1 anyone please help me to make this code work urgently as i am working on a project Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---