JMeter retrieving JSON return information via JSON extrcator or regular expressions

Source: Internet
Author: User

1,, and plug-in document information

https://jmeter-plugins.org/wiki/JSONPathExtractor/

The JSON information is as follows

{
"Error_code": 0,
"Stu_info": [
{
"id": 5047,
"Name": "LW",
"Sex": "Male",
"Age": 28,
"Addr": "No. 32nd, Xi ' an high-tech zone, Shaanxi",
"Grade": "Scorpio",
"Phone": "15512532946",
"Gold": 1600
}
]
}

2. Add JSON path extractor or JSON extractor or regular expression extractor to the HTTP request

3. How to configure the JSON plugin and how to configure the regular expression

4. View Results

5. How to use JSON

{"Store": {"book": [       {"category":"Reference","Author":"Nigel Rees","title":"Sayings of the Century","Price": 8.95}, {"category":"Fiction","Author":"Evelyn Waugh","title":"Sword of Honour","Price": 12.99}, {"category":"Fiction","Author":"Herman Melville","title":"Moby Dick.","ISBN":"0-553-21311-3","Price": 8.99}, {"category":"Fiction","Author":"J. R. R. Tolkien","title":"The Lord of the Rings","ISBN":"0-395-19395-8","Price": 22.99}],"Bicycle": {"Color":"Red","Price": 19.95}}}
XPath JSONPath Result
< Code style= "font-family:"courier new", Courier, monospace ">/store/book/author $.store.book[* ". Author The authors of all books in the store
//author $. Author all authors
< Code style= "font-family:"courier new", Courier, monospace ">/store/* $.store.* all Things in store, which is some books and a red bicycle.
/store//price $.store. Price the price of everything in the store.
< Code style= "font-family:"courier new", Courier, monospace ">//book[3] $. BOOK[2] the third Book
//book[last ()] $. book[(@.length-1)]
$. Book[-1:]
the last book in order.
< Code style= "font-family:"courier new", Courier, monospace ">//book[position () <3] $. book[0,1]
$. Book[:2]
the first Books
//BOOK[ISBN " $. Book[? ( @.isbn)] filter All books with ISBN number
< Code style= "font-family:"courier new", Courier, monospace ">//book[price<10] $. Book[? ( @.price<10)] filter all books cheapier than
//* $..* All Elements in XML document. All members of the JSON structure.

JMeter retrieving JSON return information via JSON extrcator or regular expressions

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.