-
JDBC
- 配置JDBC Connenction Configuration
- JDBC Request
- Variable Name Bound to Pool
引用JDBC Connenction Configuration中的Variable Name for created pool
- Query Type
- Select Statement
- Update Statement
- Prepared Update Statement
使用parameter values
- Prepared Select Statement
- ...
- Query
- sql
- 可以使用函数
- 例如 SET end_time ='${__time(yyyy-MM-dd 00:00:00)}'
- ${__timeShift(yyyy-MM-dd 00:00:00,,P3D,,)}
- ${__timeShift(yyyy-MM-dd 00:00:00,,P-${__Random(4,6,)}D,,)},${instanceId}
- ?引用parameter value
- Parameter values
- Parameter types
-
json
- Bean Shell PostProcessor
- import org.json.*;
- 获取获取请求的返回值
String response_str = prev.getResponseDataAsString();
- 将String类型的返回值构造成JSONObject对象,提取data构造成JSONArray对象
JSONObject response_obj = new JSONObject(response_str);JSONArray data_arr = response_obj.getJSONArray("data");
- 获取Province数组的长度
int len = data_arr.length();
- 遍历data_arr,保存键值
for(int i=0 ;i < len;++i){ JSONObject job = (JSONObject) data_arr.get(i);// log.info(job.getString("jobDesc")); if(job.getString("executorHandler").contains(executorHandler_1)||job.getString("executorHandler").contains(executorHandler_2)){ log.info(job.getString("executorHandler")); if(job.getString("executorHandler").contains(executorHandler_1)){// String id_1=job.getString("id"); log.info(job.getString("id")); vars.put("id_1",job.getString("id")); }else{// String id_2=job.getString("id");log.info(job.getString("id")); vars.put("id_2",job.getString("id")); } }
posted @
2019-03-09 15:23
margot921
阅读(
184)
评论()
编辑
收藏
举报