9, Jmeter's XPath assertion

Definition: XPath is the XML path language, which is a language used to determine the location of a certain part of an XML document. XPath is based on the XML tree structure and provides the ability to find nodes in the data structure tree.
Target: Assert the data type whose return information is XPath.
How to add: Right-click request-Add-Assertion-
Insert picture description here
XPath Assertion After selecting the mode, add XPath Assertion to
Insert picture description here
add the assertion result:
Insert picture description here
clear the previous result, click Start, and run the test.
Insert picture description here
We can see that there is no error, and then we can see that the assertion result
Insert picture description here
is normal. It means that our XPath Assertion assertion succeeded.
Let’s take a look at the error situation. First, let’s deliberately write a wrong XPath Assertion, remove one]
Insert picture description here
Then, clear the previous result, click Start, run the test, and see the result. The
Insert picture description here
error means that this is missing]
We can Seeing XPath Assertion and corresponding response assertion is actually that this one uses text directly and the other is to fill in XPath. In fact, we use the most response assertion.
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_45608577/article/details/108611464