Watir-Classic 3.1.0 execute_script issue

0

I am in the process of upgrading from WATIR 2.0.4 to 3.1.0. I ran into the following error when trying to "kill pop-ups" before they get executed. What can I do to fix this?

Windows XP

Ruby 1.9.3

Cucumber 1.1.9

Watir-Classic 3.1.0

(in OLE method `execScript': )
    OLE error code:80020101 in <Unknown>
      Could not complete the operation due to error 80020101.
    HRESULT error code:0x80020009
      Exception occurred. (WIN32OLERuntimeError)

29
30Then /^I kill the popups$/ do
31  @browser.execute_script "window.confirm = function() { return true; }"
32  @browser.execute_script "window.alert = function() { return true; }"
33  @browser.execute_script "window.prompt = function() { return true; }"
ruby
watir
asked on Stack Overflow Sep 18, 2012 by Enrique • edited Sep 18, 2012 by Enrique

1 Answer

1

This means that you're getting some JavaScript error. You could see more of that error message from your IE.

Nevertheless i'd recommend you to use Watir Alert API instead. Refer to the usage examples at http://watirwebdriver.com/javascript-dialogs/

answered on Stack Overflow Sep 20, 2012 by Jarmo Pertman

User contributions licensed under CC BY-SA 3.0