HTML responses are by far the most common responses you will get when scripting against web applications in general. That should come as no surprise since the language of the Web is HTML. HTML DOM elements are used to render all the presentation layer of a website. Since most HTML elements have a beginning and closing tag, for example,
<head></head>, and so on, their structure closely resembles that of XML documents, which we covered in the Handling XML responses recipe, and hence they are sometimes referred to as (X)HTML documents. They aren't exactly the same, but it suffices to know they are similar. That said, testing them is very similar to testing XML responses.
In this recipe, we will cover ...