Problem resolved.
First -- I don't actually know if this is, or is not, a modal dialog, since the:
"if (modal = ie.modal_dialog(:hwnd, hwnd))"
statement cannot be parsed (because apparently, even in the 1081 code branch 
the :hwnd parameter is not recognized for this method call.)

However, I resolved the problem by brute force (non elegantly.) This is how I 
did it.
===
require 'watir'
require 'test/unit'
class TC_article_example < Test::Unit::TestCase
        def test_search
  # open the IE browser
  ie = Watir::IE.new
  # steer to google
        ie.goto('http://www.google.com/')
  # load the search field
        ie.text_field(:name, "q").set("pickaxe")
  #Ensure popup won't block Watir
  ie.button(:name, "btnG").click_no_wait
  #Handle the popup
  hwnd = ie.enabled_popup(5)
  if (hwnd) #yes there is a popup
   p hwnd
   w = WinClicker.new
   w.makeWindowActive(hwnd)
   w.clickWindowsButton_hwnd(hwnd, "Yes")
  end
  # insert pause or it doesn't work...
  sleep 3
  # Validate response
  assert(ie.pageContainsText("Programming Ruby"))
  end
end
===
The key things.
1st, I used the click no wait feature: ie.button(:name, "btnG").click_no_wait
2nd, I made use of the new "enabled_popup" functionality to get hwnd.
3rd, I used WinClicker to access and kill the security popup
4th and finally, I had to insert that sleep statement or...it would fail with 
this error on the assert call: "<nil> is not true." Why this should occur I 
don't know and I find troubling...perhaps someone can explain why this works.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=4012&messageID=11336#11336
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to