How to write assertion parameters in JMeter?

In JMeter, the syntax for assertions varies depending on the type of assertion. Here are several common ways to write assertion parameters:

  1. Response Assertion can be configured with the following parameters:
  2. Pattern to be tested can be either a regular expression or a string.
  3. Do you use regular expressions?
  4. Negate: Whether to invert the pattern result.
  5. When matching, you can choose rules such as “Contains”, “Equals”, “Substring”, or “Not”.
  6. Set parameters to match 2 assertions (XPath Assertion):
  7. XPath: XPath expression is used to select XML nodes that need to be matched.
  8. Validate XML: Do you want to validate the format of the XML?
  9. JSON Assertion: parameters can be set as follows:
  10. JSON Path expressions to be tested: The JSON paths to test can be either single or multiple.
  11. Expectations can be in the form of strings, numbers, boolean values, etc.
  12. HTML Assertion: Parameters can be set as follows:
  13. HTML assertions: HTML tags used to select HTML elements to be tested.
  14. Attribute: The attribute to be tested can be selected as “contains” or “matches”.

The above are some common ways to write assertion parameters. Depending on the specific needs and scenarios, you can choose the appropriate type of assertion and set the corresponding parameters.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds