20171213-python Automation-Interface test-jmeter-post-Set cookie

Source: Internet
Author: User
Tags http cookie set cookie

Interface 4: Student coin Recharge

Brief description: Add a cookie to authenticate the identity

Request Method: Post

Request URL:http://api.nnzhp.cn/api/user/gold_add

1, open JMeter, right click on the test plan, select Add-threads-thread Group, copy the login script to the current thread group

2, click Login (HTTP request) Right: add--post processor [email protected]-JSON Path Extractor;name Enter sign (session name), Jsonpath expression input $. Login_info.sign (depending on the target parameter

Hierarchy location edit path), default value: Defaults can not be filled

3, click on Thread Group, right-add listener-view result tree

4, click on Thread Group, right-add sampler-http request

5,http Request page, server name or IP field input: api.nnzhp.cn; method select Post; path input:/api/user/gold_add

6,http request page, click Parameters, click Add--Configure the Component--http Cookie Manager, name enter the login username XXX (Administrator account in login script), value, input ${sign} (jmeter call login Script Login

After getting to the sign), domain api.nnzhp.cn

4, click on Thread Group, right-add listener-View results tree, click the toolbar green small arrow to execute the script

5, click View Results tree, view request URL and response data

POST Http://api.nnzhp.cn/api/user/gold_add

POST Data:
stu_id=2415&gold=54321

Cookie Data:
Xxx=cd2b43f1688e472e3a516b5a2c6831e8

{
"Error_code": 1000,
"MSG": "Operation successful?"
}

20171213-python Automation-Interface test-jmeter-post-Set cookie

Related Article

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.