...
|
...
|
@@ -60,7 +60,7 @@ |
|
|
<boolProp name="ignoreFirstLine">false</boolProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="购物车-编辑add" enabled="true">
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="购物车add-select" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
...
|
...
|
@@ -188,6 +188,86 @@ vars.put("searchValue",req+"&client_secret="+md5code); |
|
|
</ResponseAssertion>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="Constant Throughput Timer" enabled="true">
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>150000.0</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="购物车add-remove" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
|
|
<intProp name="LoopController.loops">-1</intProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="ThreadGroup.num_threads">150</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1501638755000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1501638755000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_add" enabled="true">
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
|
|
|
<collectionProp name="Arguments.arguments"/>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.protocol"></stringProp>
|
|
|
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
|
|
|
<stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
|
|
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
|
|
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置MD5" enabled="true">
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="parameters">${uid_cart_edit} ${shopping_key_edit} ${sku_edit}</stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
|
|
|
String req = "app_version=5.8.0&buy_number=1&client_type=test&edit_product_sku=0&goods_type=0&method=app.Shopping.add&os_version=yohobuy:web&private_key=fd4ad5fcfa0de589ef238c0e7331b585&product_sku="+bsh.args[2]+"&promotion_id=&screen_size=720x1280&selected=Y&session_key=5103fd2c7217459929865c1da6aa7f5a&shopping_key="+bsh.args[1]+"&uid="+bsh.args[0]+"&v=7";
|
|
|
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
|
|
byte[] btResult = md.digest();
|
|
|
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
for(byte b : btResult){
|
|
|
int bt = b&0xff;
|
|
|
if(bt<16){
|
|
|
sb.append(0);
|
|
|
}
|
|
|
sb.append(Integer.toHexString(bt));
|
|
|
}
|
|
|
String md5Str = sb.toString();
|
|
|
vars.put("searchValue",req+"&client_secret="+md5Str);
|
|
|
</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="723337899">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
|
|
|
<boolProp name="Assertion.assume_success">false</boolProp>
|
|
|
<intProp name="Assertion.test_type">16</intProp>
|
|
|
</ResponseAssertion>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_removeAndCart" enabled="true">
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
|
|
|
<collectionProp name="Arguments.arguments"/>
|
...
|
...
|
@@ -249,13 +329,13 @@ vars.put("searchValue",req+"&client_secret="+md5code);</ |
|
|
<intProp name="calcMode">2</intProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>150000.0</value>
|
|
|
<value>3000.0</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="购物车-编辑inc" enabled="true">
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="购物车add-inc" enabled="true">
|
|
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
|
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
|
|
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
...
|
...
|
|