jmeter--bean shell断言所需要的包

时间:2021-12-02 10:03:33
【文件属性】:

文件名称:jmeter--bean shell断言所需要的包

文件大小:566KB

文件格式:JAR

更新时间:2021-12-02 10:03:33

jmeter beanshell

下载的jar包直接放入/lib/ext目录即可使用 import java.util.Arrays; import com.alibaba.fastjson.*; String response_data = prev.getResponseDataAsString(); JSONObject response_obj = JSONObject.parseObject(response_data); JSONObject data = response_obj.getJSONObject("data"); JSONArray result = data.getJSONArray("cusSvcDocs"); int size=result.size(); String[] docId=new String[size]; String[] docStatus=new String[size]; for (int i = 0; i < size; i++) { JSONObject jsonObject=result.getJSONObject(i); docId[i]=jsonObject.getString("docId"); docStatus[i]=jsonObject.getString("docStatus"); System.out.println(jsonObject.getString("docId")+":"+jsonObject.getString("docStatus")); if((docId[i].equals("1224767876439842995")&&docStatus;[i].equals("70"))||(docId[i].equals("1224767274024546851")&&docStatus;[i].equals("80"))) { Failure = false; FailureMessage = "断言正确"; } else { Failure = true; FailureMessage = "断言错误"; } }


网友评论