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