Enrique
Enrique

Reputation: 665

Watir-Classic 3.1.0 execute_script issue

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; }"

Upvotes: 0

Views: 509

Answers (1)

Jarmo Pertman
Jarmo Pertman

Reputation: 1905

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/

Upvotes: 1

Related Questions