Impossible site for HtmlUnit? Impossible site for HtmlUnit? ajax ajax

Impossible site for HtmlUnit?


Try adding this:

client.setThrowExceptionOnScriptError( false ) ;

It takes a long time to run, and boy does it spew out logging... but eventually a page came out:

htmlpage init'd<?xml version="1.0" encoding="utf-8"?><html id="">  <head>   ...


I also had the problem with "data necessary to complete this operation is not yet available".
Switching the user-agent to "Firefox" helped...
http://steveliles.github.com/jquery_htmlunit_runtimeerror_messages_galore.html


Browsers have a high tolerance for what they might detect as errors (in Javascript, but also HTML, css and so on).This is partly because of various conflicting "standards" :) of how Javascript got implemented. Something that appears OK on one browser gets problems on another. So when all these messages are made visible it should be a little disconcerting.

To put this in perspective - in Internet Explorer go into your settings and check the "Advanced Settings" for "Display a notification about every script error" and then browse the same sites. You might be surprised at how much code IE gets by just ignoring what it might detect as problems.

Using HtmlUnit under various browsers just brings some of these conflicts to light.

Telling HtmlUnit to do something like "Ignore...for this browser" is a perfectly valid practice.In my case, I am bringing in data from a site that checks that all the users are using Internet Explorer (No, I have no good idea why they do that), so I can't proceed without ignoring the javascript errors. Interestingly, the site works fine even though IE thinks there're lots of Javascript errors.