Modify the underlying HtmlUnit configuration on GWTTestCase

44 views
Skip to first unread message

Kerby

unread,
Jul 27, 2025, 5:18:22 AMJul 27
to GWT Users
Hi, is there a way to modify the underlying HtmlUnit configuration when running GWTTestCase. My purpose is to make HtmlUnit more relaxed and not throw or ignore CORS error.

Currently, the test in my GWT library fails due to supposedly CORS error even when the server resource is returning the CORS header.

"SEVERE: Job run failed with unexpected RuntimeException: Wrapped java.lang.RuntimeException: No permitted "Access-Control-Allow-Origin" header."

App is running on GWT 2.8.2 (for Legacy Errai support)
and is using the "gwt-maven-plugin" of the same GWT version.

Jens

unread,
Jul 27, 2025, 6:00:29 PMJul 27
to GWT Users
GWT 2.8.2 uses HTMLUnit 2.19 which should work with CORS. At least the changelog only suggest a single Chrome related fix in 2.21.

Latest GWT uses HTMLUnit 2.55 so maybe you could just override the dependency version in your project and try HTMLUnit 2.55.

It doesn't look like you can change the CORS behavior of HTMLUnit: 


If the CORS preflight request fails to some reason you are out of luck. Maybe the CORS header is incorrect or there is some unexpected status code because of rate limiting?

-- J.

Reply all
Reply to author
Forward
0 new messages