Interface test Tool-jmeter use Note (V: Regular expression extractor)

Source: Internet
Author: User

(The regular expression extractor is one of the JMeter associations) usage scenarios:

There are two HTTP requests, and there is a field "ABCD" in the return data of request a, which is to be used as the entry for request B.

1. How to add

Request a right-to-back processor, regular expression extractor

2. Extract the corresponding value of Taskcode in Request a

To get to this value in the circle, configure the regular expression extractor:

Description

(1) Reference name: The name of the parameter to be referenced by the next request, such as filling in atask, you can use ${atask} to reference it.

(2) Regular expression:

(): The enclosed part is to be extracted.

.: Matches any string. +: one or more times.: Don't be greedy, stop after you find the first match.

(3) Template: Referenced by $$, if there are more than one regular expression in the regular expression, it can be $2$$3$ and so on, which represents the number of the parsed to the title. Example: $1$ represents the 1th value resolved to

(4) matching numbers: 0 for random values, 1 for all values, usually for 0

(5) Default value: If the parameter does not get the value, it defaults to a value let it take, I fill in the error.

3. Gets the value of the incoming B request

See if Request B passes the Atask value as expected

Citation successful ~ ~

Record a handy tool for testing regular expressions:

Tool Name: Regextester

How to use:

Interface test Tool-jmeter use Note (V: Regular expression extractor)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.