HtmlUnit explained

HtmlUnit
Latest Release Version:4.4.0
Programming Language:Java
Operating System:Cross-platform (JVM)
Language:English
Genre:Web browser
License:Apache License 2.0
Website:https://htmlunit.sourceforge.io/

HtmlUnit is a headless web browser written in Java. It allows high-level manipulation of websites from other Java code, including filling and submitting forms and clicking hyperlinks. It also provides access to the structure and the details within received web pages. HtmlUnit emulates parts of browser behaviour including the lower-level aspects of TCP/IP and HTTP. A sequence such as getPage(url), getLinkWith("Click here"), click allows a user to navigate through hypertext and obtain web pages that include HTML, JavaScript, Ajax and cookies. This headless browser can deal with HTTPS security, basic HTTP authentication, automatic page redirection and other HTTP headers. It allows Java test code to examine returned pages either as text, an XML DOM, or as collections of forms, tables, and links.[1]

The goal is to simulate real browsers; namely Chrome, Firefox and Edge.

The most common use of HtmlUnit is test automation of web pages, but sometimes it can be used for web scraping, or downloading website content.

Benefits

Drawbacks

Used technologies

Libraries using HtmlUnit

See also

Bibliography

Further reading

External links

Notes and References

  1. Web site: HtmlUnit Home. Sourceforge. 30 August 2019.
  2. Book: Next Generation Java Testing: TestNG and Advanced Concepts. 9780132702270. 30 August 2019. Beust. Cédric. Suleiman. Hani. 15 October 2007. Pearson Education .
  3. Web site: HtmlUnit Driver. Github. 30 August 2019.
  4. Web site: Testing HTML Unit. GWT Project. 30 August 2019.