The best way is to open a bug report in the sourceforge bug tracking database. Sending a bug report to the mailing list runs the risk that the bug may get lost. Putting it in the bug database guarantees that it won't. Please search the bug database to see if your bug hasn't already been reported before opening a new one.
If you know how to fix the problem then patches are gratefully accepted.
The best way is to open a bug report in the sourceforge bug tracking database. See the answer on bug reporting for why the database is preferred.
If you're willing to write the feature yourself, you can always send us a patch.
webClient.getOptions().setJavaScriptEnabled(...);
webClient.getOptions().setThrowExceptionOnFailingStatusCode(...);
webClient.getOptions().setThrowExceptionOnScriptError(...);
webClient.getOptions().getProxyConfig().set...();
The main thread using HtmlUnit may be finishing execution before allowing background threads to run. You have a couple of options:
//try 20 times to wait .5 second each for filling the page.
for (int i = 0; i < 20; i++) {
if (condition_to_happen_after_js_execution) {
break;
}
synchronized (page) {
page.wait(500);
}
}
You can subclass HttpWebConnection and override getResponse() as:
new WebConnectionWrapper(webClient) {
public WebResponse getResponse(WebRequest request) throws IOException {
WebResponse response = super.getResponse(request);
if (request.getUrl().toExternalForm().contains("my_url")) {
String content = response.getContentAsString("UTF-8");
//change content
WebResponseData data = new WebResponseData(content.getBytes("UTF-8"),
response.getStatusCode(), response.getStatusMessage(), response.getResponseHeaders());
response = new WebResponse(data, request, response.getLoadTime());
}
return response;
}
};
HtmlUnit relies on HttpClient 4 for Cookie handling. If you have an issue, please post it to the HtmlUnit mailing list.
26.02.2003 16:07:05 org.apache.commons.httpclient.HttpMethodBase processRedirectResponse INFO: Redirect requested but followRedirects is disabled
It's an annoyance that I haven't figured out how to fix yet.
For a variety of reasons, I handle the redirection logic inside HtmlUnit rather than letting commons-httpclient handle it for me. It's commons-httpclient that is displaying that message because I have explicitly disabled its redirection support.
I'd like to filter out that warning message but haven't figured out a clean way of doing it. A number of people have pointed out that it's easy to disable a message if you know which logger is being used. The problem is that there isn't a way to disable the messages without knowing the logger in use.
There is no "roadmap" of releases. Features will be added as they are written.
Changes to the product (including new features) are implemented by volunteers in their spare time. If feature X is important to you and nobody seems to be working on it then perhaps you should consider writing it yourself and submitting a patch.
Make sure (a) that you are using the latest version of HtmlUnit, and (b) that you are calling WebClient.closeAllWindows() when you are finished with your WebClient instance.