HTML Assertion

JMeter – HTML Assertion

HTML Assertion is a rarely used assertion component in JMeter script that emphasizes web layout accuracy and tag validation. The HTML assertion uses JTidy, an HTML syntax-checking tool, to parse the web page returned in the response, and then returns a pass or fail result. The number of errors and warnings is shown in the output if the statement is false.

How do you add ‘HTML Assertion’?

You can perform the following actions:

  1. Determine which HTML response of the ‘Sampler’ element should be checked.
  2. Right-click on the node.
  3. Place your cursor on ‘Add’.
  4. Hover over “Claims.”
  5. Select ‘HTML Confirmation’.

JMeter - HTML Assertion

What are the ‘HTML Assertion’ input fields?

There are the following input areas for “HTML Assertion“:

  • Name: To specify the name of the assertion, Leave any comment random.
  • Clean up the configuration: Tell JMeter to perform a specific action, such as skip (ignore), automatic (run as usual), strict (to check all syntax), or loose (to allow child elements to be ignored).
  • Format: How the response is formatted. The options are XHTML, XML, and HTML.
  • Errors only: After checking, JMeter only considers syntax errors and ignores warnings.
  • Error threshold: to specify the number of errors that can be ignored and the request accepted.

The maximum number of warnings that can be ignored before the request is considered successful.

  • Report written to JTidy file: Enter the path and file name for the report file that will be created when the test is complete run.  
Scroll to Top