WATIR - ScriptError popup on IE - Unable to get rid of!

I am new to Ruby & Watir, and I am having a nightmare with IE and Script
Error popups on unspecified pages, and I need a way to supress these, or
get rid of them. My Ruby/Watir script runs perfectly well, apart from
these pesky “Script Error” popups.

I have tried all manner of different pop-up blocking bits of Watir, but
no joy at all. I cant even change focus and clear it that way as
“browser.close” doesnt do anything.

These popups are not proper IE windows, and are not JavaScript errors. I
have changed all manner of Windows/IE settings, but these script errors
will not go away.

Any help would be greatly appreciated.


It looks like there’s an Adobe Flash element on the page which is
causing a problem.
If you follow the steps manually using IE with “No Add Ons”, do you
experience the same error?

If you are using watir-webdriver with Firefox or Chrome you can disable
Flash, that may help.
(I don’t believe this works with IE yet)

Also, for Firefox there is a watir plugin to test flash, so that may be
possible too.

Thanks all, I wasn’t anticipating a response that quickly!

Joel - With add-ons turned off, the issue doesn’t happen. If I turn
add-ons back on again, the issue comes back.

David - This doesn’t happen with either Chrome or FireFox weirdly! We
need flash to be left on due to the nature of the testing we will be
completing with this script.

Thai - All script debugging is already turned off in IE, so im not sure
why it insists on producing the error still! Attached is a screen shot
of my IE script debugging settings.

Due to the nature of the testing we will be completing with this script,
it wont be sites that we have control over, and we cant run the tests
without JavaScript/Flash.

Is there any way to get Watir to recognise this error and deal with it,
I tried most of the afternoon yesterday to sort it with various
different solutions about on the Internet.

Hey Graeme,

This looks like a message from IE script debugging, which you can turn
off and it should disable all of the similar error messages.

You want Tools>Internet Options>Advanced>Disable Script Debugging tick
that one, and un tick Display a notification about every script error.


Author of Ruby For System A.s

The same script will be used in IE/FireFox & Chrome, not simultaneously,
but IE will be used. Flash needs to be enabled for our testing.

Is there a way for Watir to deal with this error, or should I just kill
the IE process to get rid of it?


Sorry, example URL:

And click on one of the links on the page when the page has loaded to
get the error.

I’ve used Watir with IE to navigate around the links on that site
without incident. I can’t find the error message. The Flash elements
appear to work fine as well.
I’m using a default install of IE 10.0.9200 with Add-Ons enabled.

Im using IE9 with add-ons enabled, and flash 11.7.

Ill get IE10 installed, and ill try it again and see if that makes a

When you say you can’t run the tests without JavaScript / Flash… I can
see how JavaScript might be essential, but are you certain that Flash is
essential? Perhaps you could specifically disable Flash in IE for these

IE handles Flash differently from other browsers, and I find it to be
the least stable browser as well. Have you considered using more capable
browsers for your testing, such as Firefox? Watir-Webdriver will support
most common browsers whereas Watir only supports IE.

I can’t do much testing without being able to replicate this error. Can
you provide a URL which consistently causes this error to appear?

Hi Joel,

I now have IE10 installed, and it works fine for me also.

Looks like ill have to upgrade all my machines to IE10…