Im using HtmlUnit as the headless browser, and it “doesn work.” Why not?
If “doesn’t work” means that HtmlUnit does not return the snapshot you were expecting to see, it’s very likely that the culprit is that you didn’t give it enough time to execute the JavaScript and/or XHR requests. To fix this, try any or all of the following: • Use NicelyResynchronizingAjaxController. This will cause HtmlUnit to wait for any outstanding XHR calls. • Bump up the wait time for waitForBackgroundJavaScript and/or waitForBackgroundJavaScriptStartingBefore This will very likely fix your problem. If it doesn’t, you can also try the FAQ for HtmlUnit. HtmlUnit also has a user forum.