Skip to content

Migrate from net.sourceforge.htmlunit to org.htmlunit#16

Open
akshayrai10 wants to merge 2 commits intomasterfrom
issue/migrate-to-org-htmlunit
Open

Migrate from net.sourceforge.htmlunit to org.htmlunit#16
akshayrai10 wants to merge 2 commits intomasterfrom
issue/migrate-to-org-htmlunit

Conversation

@akshayrai10
Copy link
Copy Markdown

@akshayrai10 akshayrai10 commented Apr 7, 2026

Summary

  • Upgrades HtmlUnit from the abandoned net.sourceforge.htmlunit coordinates to the actively maintained org.htmlunit:htmlunit:3.9.0, resolving two critical CVEs
  • Updates the Selenium HtmlUnit Driver in jwebunit-webdriver-plugin from selenium-htmlunit-driver:2.52.0 to htmlunit3-driver:4.13.0, which is the only Selenium 4 driver that correctly depends on org.htmlunit:htmlunit:3.x and fully removes net.sourceforge.htmlunit from the classpath
  • Fixes all API breaking changes introduced in HtmlUnit 3.x

Key API Breaking Changes Addressed

  • Package rename: all com.gargoylesoftware.htmlunit.* → org.htmlunit.*
  • DefaultCredentialsProvider.addCredentials(): password changed from String to char[]; addNTLMCredentials() removed, replaced with generic addCredentials() (NTLM negotiation is handled internally by HtmlUnit)
  • HC5 shading: HtmlUnit 3.x bundles Apache HttpClient 5 internally, HC5 types are not importable by downstream consumers. Cookie.toHttpClient() replaced with direct org.htmlunit.util.Cookie API calls
  • HtmlElement.asText() renamed to asNormalizedText()
  • HtmlInput value semantics: in HtmlUnit 3.x, setValueAttribute() mutates the HTML attribute (the form-reset default) rather than the live DOM value. Replaced with setValue() at all call sites that intend to set user-visible field values; getValueAttribute() → getValue() for reading live DOM values
  • CapabilityType.SUPPORTS_JAVASCRIPT: removed in Selenium 4 with no named constant replacement (W3C WebDriver spec does not include javascriptEnabled). Replaced with string literal "javascriptEnabled"
  • XPath engine: HtmlUnit 3.x uses a strict XPath 1.0 evaluator (Apache Xalan). lower-case() (XPath 2.0) replaced with translate() equivalent in WebTester.java

Rovo Dev code review: Rovo Dev couldn't review this pull request
Upgrade to Rovo Dev Standard to continue using code review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant