I have a problem with watir and javascript popup window
here's my test script
require 'watir'
browser = Watir::Browser.start "/url/"
browser.link(:text, /Add New Blog/).wait_until_present
browser.link(:text, /Add New Blog/).click
// Here is where the javascript window popup
window = browser.ie.Document.ParentWindow
browser.window(:title, /Blog/) do
browser.text_field(:id, /text title of Blog/).set 'Watir'
browser.select_list(:id, /dropdownlist type/).select ("News")
browser.button(:value, /Save/).click
end
The problem is after window popup shows, it's unable to locate the element of the text_field in window Blog. I also have try this but it says that => in 'window': wrong number of arguments (2 for 1) (ArgumentError)
browser.window(:title => "annoying popup").use do
browser.button(:id => "close").click
end
Any solution? and btw Im using ruby 1.9.3. Appreciate your help.TQ