jmeter3.0 webservice接口测试 每个线程发送不同的数据
和http请求参数类似,webservice直接将Soap/XML-RPC Data报文中需要变化的值替换为函数即可。 ${__CSVRead(G:tmpsendMsg.txt,0)},第一个线程读第一行第一列,第二个线程读第二行第一列。 先将完整报文写入Soap/XML-RPC Data中,红色部分是要变化的部分 <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:sendMsg soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://server.webservice.xt.java.com/"><arg0 xsi:type="xsd:string">{"time":"20161124113553","duration":"2","serialId":"ycwp201611241135533526","length":4704,"format":"amr","type":2,"deviceId":"123456789"}</arg0></ns1:sendMsg></soapenv:Body></soapenv:Envelope> 更改后 <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:sendMsg soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://server.webservice.xt.java.com/"><arg0 xsi:type="xsd:string">{"time":"20161124113553","deviceId":"${__CSVRead(G:tmpsendMsg.txt,0)}"}</arg0></ns1:sendMsg></soapenv:Body></soapenv:Envelope> 完整界面: 在指定路径配置好请求中需要的数据,就能看到每个线程发送的数据不一样了。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |