Tips and solutions to use Selenium in IE automation

Selenium is a powerful open source project that ensembles a wide range of tools to let the user make automation of tasks and regression tests. Using Selenium to control Internet Explorer (IE) can be very tricky, since the driver of IE is not officially provided by Microsoft.

This post intends to show tips, some errors and solutions that I struggle to solve when using a Selenium Server Standalone to drive IE, if you have some error to suggest I will enjoy see a comment.

When trying automate IE the first step is follow the official required configurations [1], some steps can be not necessary depending of you environment. The environment that I use is the last releases of IE 11 and Windows 10, but some people may need run Selenium in some olds configurations like IE 7/XP, IE 8/Windows 8, etc.

Common and uncommon problems:

INFO: HTTP Status: '500' -> incorrect JSON status mapping for 'script timeout' (408 expected)

I don’t know the exactly reason of the error above, and is the type of error that even researching a lot about, is uncommon and have ambiguous solutions. But, this response [5] on Katalon Community about this error give me a insight, about incompatibles syntax on JSON implementation used in the communication between the Standalone Server and the implementation of IE Driver. I solved this just changing the version of Selenium Server Standalone to 3.9.1 and IE driver 3.9, before I was using Selenium Server Standalone 3.141.

If you’re using methods like executeScript() from JavaScriptExecutor a common error is trying execute JavaScript syntax that IE doesn’t support, like .forEach(), even in the latest releases of IE is not supported and throw a Javascript error like the bellow:

 org.openqa.selenium.JavascriptException: JavaScript error

You will need rewrite the JS that you’re trying to execute or use some Polyfill before the code (I didn’t try this).

I will try update more this post, because work with IE and Selenium always generate some uncommon troubles.

  1. https://github.com/SeleniumHQ/selenium
  2. https://github.com/SeleniumHQ/selenium/issues/4292
  3. https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver
  4. http://jimevansmusic.blogspot.com/2012/08/youre-doing-it-wrong-protected-mode-and.html
  5. https://forum.katalon.com/t/internet-explorer-error-incorrect-json-status-mapping-for-no-such-window/33358/2

Leave a Reply

Your email address will not be published. Required fields are marked *