JMeter使用beanshell断言处理json格式的报文

背景:JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式。也是我们实际工作中常见的数据格式,经常同xml的数据格式进行对比,后者在soap协议中使用。

1、以http协议接口测试为例,响应报文是json格式的,格式如下:{"datas":[{"id":1,"goods_id":"goods_001","brief":null,"img":{"thumb":"http://image/1_0.jpg","url":"http://image/1_0.jpg","small":"http://image/1_0.jpg"},"market_price":"3.0","name":"A1000","promote_price":"4.2","shop_price":"5.0"},{"id":2,"goods_id":"goods_002","brief":null,"img":{"thumb":"http://image/1_0.jpg","url":"http://image/1_0.jpg","small":"http://image/1_0.jpg"},"market_price":"4.0","name":"B2000","promote_price":

你可能感兴趣的:(JMeter轻量级性能测试工具,beanshell断言,json格式)