单击按钮后,将打开一个新的 Windows 警报。我尝试使用此代码:
browser.button(:name => 'OpProvisionalCreate').click
browser.execute_script("window.confirm = function() {return true}")
browser.window(:title => "Message from webpage").use do
browser.button(:id => "close").click
end
但我收到一条错误消息:
:in `<top (required)>': undefined method `window' for #<Watir::IE:0x1a76990> (NoMethodError)