First, create a thread group, add http request, specific settings shown in Figure 1:
figure 1
Then, add XPath Extractor post-processor, the specific set of parameters, and the expression 2:
figure 2
You can add Debug PostProcessor, to view xpath extracted content is correct.
The following are parameters introduced Xpath page.
APPly to: scope (returns the contents of assertions range)
the Main Sample and Sub-the Samples: acting on the sampler sampler and the corresponding child nodes of the parent node
Main sample only: applied only to a parent node sampler
Sub-samples only: only acts on a child node of the sampler
jMeter variable: acting on jmeter variable (input box you can enter the name of the variable jmeter)
XML parsing Options: XML to parse parameters
UseTidy: when a page needs to be handled in HTML format, you must select the option; if it is XML or XHTML format (such as RSS returns), uncheck;
Quiet display only the required HTML pages,
Report errors indicate display response error,
show represents warnings indicate a warning;
the Use Namespaces: If this option is enabled, the follow-up XML parser will use namespaces to distinguish;
the Validate XML: check resolved according to the page element patterns;
ignore Whitespace: ignore white space;
Fetch external DTDs: to get the content of the page if checked, will use an external DTD rules;
the Return Entire XPath fragment of text content: returns the entire text XPath fragments;
Reference Name: storing parameter values extracted.
XPath Query: for XPath expressions to extract the value.
Match numbers: take the first few matches, the random 0, -1 full, 1 for the first, 2 for the second, and so on ....
Default Value: Default parameters.
Http request to add, enter an application name defined in the xpath path. Referring specifically to Figure 3:
image 3
Running, you can view the results in aggregation report.