Today, I was trying to run some selenium tests on Internet Explorer 8 and got another “This is why I hate Internet explorer” problem. All the selenium tests work fine in Firefox but as soon as I started running them in Internet Explorer, lots of javascript error popups started coming up. The popups were blocking the selenium tests and there was no way I could prevent those popups. In fact, this trivial problem blocked me for a day and was driving me crazy. And when I got through it at last, I thought what the fuck? I won’t let this stupid thing waste someone else’s time again. That’s why I’m writing this post so that you don’t get stuck like me again.

Well, it started with me migrating my selenium tests to webdriver. I had to migrate to webdriver (selenium 2.x) from selenium 1.x because file upload doesn’t seem to work properly (again in Internet explorer) with selenium 1. That leads me to another post – How to automate file upload in Internet explorer using selenium? But that’s another day. For now, let’s focus on preventing those javascript error popups.

How to prevent/disable javascript error popups in internet explorer?

It seems there are lots of information out there in Google on how to prevent / disable javascript error popups but none of them really worked for me. Some of them are simple settings change in IE but for some reason, all those instructions didn’t help me in any way. But finally, I got this worked when I reset the IE Settings. So, here we go all the steps I followed in order to disable those freaky javascript popups.

  1. Disable script debugging – I tried disabling the script debugging option with no use. Well, if you want to, you can disable script debugging by opening Internet Explorer -> Tools->Internet Options -> Advanced and checking the “disable script debugging” option there.
  2. Disable JavaScript error notification (both manually & using Microsoft fixit) – I tried this too but in vain. You can disable the error notifications by going to Tools->Internet Options -> Advanced and unchecking the “Display a notification about every script error” option. Or if your don’t want to do it manually, you can use the Microsoft fixit wizard available at http://support.microsoft.com/kb/822521 or follow the manual steps there
  3. Reset IE Settings – This was the last resort and it did solve the problem. The downside is that all IE settings are lost and you might not want it. But as I said, if the above steps didn’t work and you are ready to lose your IE settings, you can reset the IE settings to disable/prevent those crazy javascript errors. Well, you can find more info on the resetting procedure at http://support.microsoft.com/kb/923737/ln.

Well, with these steps, I was able to get rid of those annoying popups. If you are facing this issue, try these out and let me know the results.