Forum Discussion

lhardy's avatar
12 years ago

Page script errors whenTestComplete uses IE9

I have a very strange problem with IE9 encountering script errors on a page whenever TestComplete interacts with it. The error details look something like this:



"

User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)

Timestamp: Fri, 11 May 2012 15:53:11 UTC





Message: Function expected

Line: 1

Char: 1

Code: 0

URI: https://myserver.myintranet.net/tms_jackie/login.aspx

"



Exactly what causes the error I don't know. The line, character, and code obviously don't make any sense; in the rendered page, line 1 is a blank line and the DOCTYPE appears on line 2. But the error comes out of these circumstances:



1. When the browser mode is "Internet Explorer 9" and document mode is "Internet Explorer 9 Standards", the error occurs apparently each time the test script interacts with an object within the browser, such as setting text or clicking a button. No errors occur if the browser mode is "Internet Explorer 9 Compatibility View" and document mode is "Internet Explorer 7 Standards". The only reason I know this is because there's a default setting in IE9 that forces Compatibility mode for intranet sites but for some reason waives that if they're requested via HTTPS. The instance of the application I'm trying to test is on my intranet, so I was getting errors when browsing secure and no errors when browsing non-secure. (You better believe I burned a lot of time trying to explain that discrepancy.) After turning that option off, the errors occur both ways. The errors also always occur when testing against the production server, which is not intranet but always forces HTTPS.



2. The DOCTYPE in all cases is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">. The pages do not include an <?xml> prolog.



3. These errors have only ever appeared as a result of TestComplete tests. Performing the exact same actions manually under otherwise identical circumstances produces normal results. Likewise, if the user running the test dismisses each error dialog as it appears, the test does finish successfully.



4. Here's the really weird one. As you can see in the error details above, the user agent is supposedly "MSIE 7.0". I don't know why the details say that, because the actual user agent included with the original page request was "MSIE 9.0", confirmed with the HTTP traffic sniffer Fiddler. The MSIE 7.0 user agent *was* sent to the server when the page was requested via HTTP and the intranet setting was still on, which is the same situation that would not produce errors.



5. I doubt this one is relevant to the error, though I haven't proven it. My browser is launched using a "fake" path that resolves through a symbolic link, rather than its real path in the Program Files folder. This is done for easier teamwork across differently-configured machines.



Does anyone have any clue what causes these errors and how I can stop them?

1 Reply


  • Hi Lucas,





    In TestComplete 8.70, there is a known problem that looks very similar to your description.

    Please contact our Support Team directly to get a patch - hopefully, it will resolve the problem for you.





    When contacting Support, please refer to this Forum thread.