JMeter HTTP Post request interface test of Example

Shopping mall interface test cases

1. Interface Description:

Calls product to cart Interface

2, the request mode:

HTTP POST request

3. interface address:

/ecshop/upload/flow.php?step=add_to_cart

4. request parameters:

1) Input parameters:

JMeter HTTP Post request interface test of Example

JSON data format:
JMeter HTTP Post request interface test of Example

2) request example:

POST /ecshop/upload/flow.php?step=add_to_cart
HTTP/1.1
Host: 192.168.126.134
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64;
rv:35.0) Gecko/20100101 Firefox/35.0
Accept:
text/html,application/xhtml+xml,application/xml;q=0.
9,/;q=0.8
Accept-Language: zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded;
charset=UTF-8
Referer:
http://192.168.126.134/ecshop/upload/goods.php?id=1
Content-Length: 69
Cookie: ECS[history]=1%2C17%2C9%2C5%2C8;
ECS[display]=grid; ECS[visit_times]=2;
ECS_ID=e1d0459a234edc14230c8e8c3f12251bb699bd86
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
goods={"quick":1,"spec":
["237"],"goods_id":1,"number":"1","parent":0}

5. Return Parameter

1) response parameters:

JMeter HTTP Post request interface test of Example

2) Response Example:

JMeter HTTP Post request interface test of Example

Test Procedure

1. On the "Test Plan" right node, select Add -> Threads (users) -

Group the Thread;
2. On "Thread Group" right node, select the Add -> Sampler -> the HTTP
the Request;
3. On "HTTP Request" right node, select the Add -> The Listener -> View
Results Tree;
4. select "HTTP request" HTTP requests configuration;
5. click "save", save the test plan;
6. click "Start", run JMeter test

HTTP Request Configuration

JMeter HTTP Post request interface test of Example
Usually on the request parameter "Body data" tab:
Goods = { "Quick":. 1, "spec":
[ "237"], "goods_id":. 1, "Number": ". 1", "parent": 0}
in this example a request query string parameter, thus also can be placed "parameters" tab:
JMeter HTTP Post request interface test of Example

Guess you like

Origin blog.51cto.com/14645850/2462408