Before the blog, there jmeter describes how to request an association of common usage, namely: post-processor regular expression extractor , here's another correlation method, XPath Extractor!
The so-called association , from a business perspective, namely: some steps adjacent step there is a certain dependency, leading to the input data of a step-by-step from data on return, then you need to "associate" to establish the steps of links between.
Briefly, that: in response to a result of the request as a request parameters. . .
jmeter provide support for the association include the following two aspects:
① be able to return to the specified content on the page stored in the parameter;
② data can be GET or POST method is used to replace the parameter;
Extractor XPath to use expression extractor (Regular Expression Extractor) similar to positive, but that is not specified in Expression regular expression, but given XPath path.
First, create a new thread group, then right - add - postprocessor -XPath Extractor:
Here briefly the effect of post-processor jmeter :
Post-processor (Post Processor) is essentially a data request issued in response to the received treatment method (post-treatment) the Sampler, I introduced before the binding jmeter scope and the execution order of those elements ,
Postprocessor element must be in the right place in order to achieve the desired results.
XPath Extractor interface is as follows:
APPly to: scope (returns the contents of assertions range)
Main sample and sub-samples: the sampler acting on the child and the corresponding parent node sampler
Main sample only:仅作用于父节点的取样器
Sub-samples only:仅作用于子节点的取样器
JMeter Variable:作用于jmeter变量(输入框内可输入jmeter的变量名称)
XML Parsing Options:要解析的XML参数
Use Tidy:当需要处理的页面是HTML格式时,必须选中该选项;如果是XML或XHTML格式(例如RSS返回),则取消选中;
Quiet表示只显示需要的HTML页面,Report errors表示显示响应报错,Show warnings表示显示警告;
Use Namespaces:如果启用该选项,后续的XML解析器将使用命名空间来分辨;
Validate XML:根据页面元素模式进行检查解析;
Ignore Whitespace:忽略空白内容;
Fetch external DTDs:如果选中该项,外部将使用DTD规则来获取页面内容;
Return entire XPath fragment of text content:返回文本内容的整个XPath片段;
Reference Name:存放提取出的值的参数。
XPath Query:用于提取值的XPath表达式。
Default Value:参数的默认值。
PS:XPath是XML/XHTML中常用的选取给定节点和节点集的方法。
正则表达式提取器和XPath Extractor的区别:
① regular expression extractor to be used to extract any text of the page, the extracted content is text matching page content in accordance with the regular expression;
②XPath Extractor can extract returns any attribute of any element of the page;
③ If necessary the extracted text is the attribute value of an element on a page, we recommend using XPath Extractor;
④ If you need to extract text position on the page is not fixed, or is not an element of property, it is recommended to use regular expressions extractor.