As part of a set of Coded UI tests, a menu is clicked. However, the menu (which uses Javascript) fails to load the menu options.
The menus work fine when I run the test manually. If I refresh the page while the tests are running (or re-launch the browser), the menu options then load.
But what is weirder is this only occurs on a remote test environment. When I run the tests locally on my own machine, the menus work even when the Coded UI tests are executing the tests.
It makes absolutely no sense to me why the menus would fail to load. Could the Coded UI tests be stopping the Javascript from executing (to load the menu options)? But why does it work when I refresh the page?
Comparing my own environment and the test environment – there are no differences that I can see. I’m testing against the exact same web application (the URL points to the same web server). It’s the same version of Internet Explorer, and all the settings are the same, that I can see. Same operating system too (Windows 7).
Any ideas?
One thing to note is that the tests worked fine under IE7 document mode – although the Javascript behaviour could be different here perhaps. Currently, I have the tests running against the web application on IE9 document mode. Changing the document mode to Quirks mode also allowed the tests to work in some situations, but only for a few tests.
I’ve figured out the reason for this is that I have been recording tests in IE9 Compatibility Mode and under IE9 Document Mode. IE9 Document mode is not supported for action recordings with VS2010.
However, even if I switch the document mode to IE8 Document Mode during test playback on the remote environment, browser dialogs fail.
Therefore, there is no real solution to this problem.
Furthermore, I would thus contest Microsoft’s claim that coded UI tests are compatible with IE9 (even with VS2010 SP1) for this reason.
So I’m left with no choice but to wait until VS2012 Coded UI test tools (which offer full support for IE9, supposedly) before I can test any web pages which have browser dialogs or JavaScript menus.