I am not able to click on a java script alert using watir 2.0.4. This is the alert that i am trying to click on. And the line of the code that i am using to click on the javascript alert is
browser.javascript_dialog.button('OK').click
All i get is the error message
undefined method `javascript_dialog' for #<Watir::IE:0x46efcb8> (NoMethodError)
Do i need to install some specific gems for it to work? I thought watir is all i need and i have it already installed. Is it not supported with Watir 2.0.4 ? Please find my gems below.
I also tried supressing the java scrit alert by adding the following lines before clicking on the javascript alert. It did n't work either. Waiting for your valuable input. Thanks!
browser.execute_script "window.confirm = function() { return true; }"
browser.execute_script "window.alert = function() { return true; }"
browser.execute_script "window.prompt = function() { return true; }"
* LOCAL GEMS *
builder (3.0.0)
commonwatir (2.0.4)
ffi (1.0.10 x86-mingw32)
hoe (2.12.3)
minitest (1.6.0)
nokogiri (1.5.0 x86-mingw32)
rake (0.8.7)
rautomation (0.6.3)
rdoc (2.5.8)
s4t-utils (1.0.4)
user-choices (1.1.6.1)
watir (2.0.4)
win32-api (1.4.8 x86-mingw32)
win32-process (0.6.5)
windows-api (0.4.0)
windows-pr (1.2.1)
xml-simple (1.1.1)