Selenium and The Dialog of Doom

This is a guest post from Douglas Squirrel, CTO at youDevise

At youDevise, we’ve been suffering from what Ivan Moore calls Flickering Builds for some time now – the build fails with a false negative once, then passes the next time we run it.

Our Cruise Missile monitor records these failures for us so we can track them, and it lets us mark them so we know not to waste time on further investigation, but it’s still massively annoying when your build isn’t reliable!

One of the worst sources of build flickers is Internet Explorer causing a Selenium test run to hang. When IE has an issue with JavaScript, it throws up a dialog box and then sullenly refuses to budge until it’s clicked. This is particularly bad because it hangs everything else up the food chain to Hudson, and nobody else can run an IE build until we bow to Bill Gates and click OK, dammit!

The root causes of the JavaScript error vary, but the behaviour of IE (when running under HTA mode in Selenium) is a problem that we need a countermeasure for. The Build Doctor made a house call recently and suggested one of these could be the cure for us:

  1. detect the dialog and, when you do, click it or else kill all browsers on the machine
  2. try proxy injection mode for IE under Selenium
  3. modify Selenium to fail the test and kill the browser when the dialog is detected
  4. wait for webdriver to merge with Selenium (it’s supposed to be more resilient in the face of evil dialogs)
  5. wait for IE to die

We’re trying to convince Julian to have a go at one of the first three (webdriver will surely ride to our rescue before the IE zombie falls over, but neither one seems likely before the next Star Trek movie). If we can get it working we’d like to make the solution open source, ideally part of Selenium. Surely others are suffering with the same problem and would benefit from an end to the Dialog of Doom. Stay tuned!

Image thanks to OiMax

Tagged ,

One thought on “Selenium and The Dialog of Doom

  1. Chris M says:

    One crude as hell option we used a while ago was to kill the process if it too long to complete which was invariably to do with IE failing as you describe. In the absence of a nice fix, this did the trick pretty well given a sensible timeout choice.

Comments are closed.

%d bloggers like this: