...
|
...
|
@@ -216,7 +216,7 @@ |
|
|
<stringProp name="shareMode">shareMode.all</stringProp>
|
|
|
</CSVDataSet>
|
|
|
<hashTree/>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_web_productBanner_data" enabled="true">
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_Shopping_queryCart" 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>
|
...
|
...
|
@@ -229,10 +229,10 @@ |
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">根据产品ID查询banner(商品详情促销banner)</stringProp>
|
|
|
<stringProp name="TestPlan.comments">查询用户购物车</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_web_productBanner_data" enabled="true">
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_queryCart" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
...
|
...
|
@@ -257,317 +257,23 @@ |
|
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">根据产品ID查询banner(商品详情促销banner)</stringProp>
|
|
|
<stringProp name="TestPlan.comments">查询用户购物车</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${product_id}</stringProp>
|
|
|
<stringProp name="parameters">${cart_shopping_key} ${cart_uid}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"web"};
|
|
|
String[] privateKeys = {"0ed29744ed318fd28d2c07985d3ba633"};
|
|
|
String[] clientTypes = {"android"};
|
|
|
String[] privateKeys = {"fd4ad5fcfa0de589ef238c0e7331b585"};
|
|
|
int rd = new Random().nextInt(1);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
|
|
|
String req = "app_version=5.8.0&client_type="+clientType+"&method=web.productBanner.data&os_version=yohobuy:web&private_key="+privateKey+"&product_id="+bsh.args[0]+"&screen_size=720x1280&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 md5 = sb.toString();
|
|
|
|
|
|
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<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>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>60000</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_web_brand_banner" 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">80</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">根据品牌ID查询banner</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_web_brand_banner" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></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>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">根据品牌ID查询banner</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${brand_id}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"web"};
|
|
|
String[] privateKeys = {"0ed29744ed318fd28d2c07985d3ba633"};
|
|
|
int rd = new Random().nextInt(1);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
|
|
|
String req = "app_version=5.8.0&brand_id="+bsh.args[0]+"&client_type="+clientType+"&method=web.brand.banner&os_version=yohobuy:web&private_key="+privateKey+"&screen_size=720x1280&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 md5 = sb.toString();
|
|
|
|
|
|
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<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>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>60000</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_web_productComfort_data" 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">80</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">根据产品ID查询舒适度</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_web_productComfort_data" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></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>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">根据产品ID查询舒适度</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${product_id}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"web"};
|
|
|
String[] privateKeys = {"0ed29744ed318fd28d2c07985d3ba633"};
|
|
|
int rd = new Random().nextInt(1);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
|
|
|
String req = "app_version=5.8.0&client_type="+clientType+"&method=web.productComfort.data&os_version=yohobuy:web&private_key="+privateKey+"&product_id="+bsh.args[0]+"&screen_size=720x1280&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 md5 = sb.toString();
|
|
|
|
|
|
|
|
|
vars.put("searchValue",req+"&client_secret="+md5);</stringProp>
|
|
|
</BeanShellPreProcessor>
|
|
|
<hashTree/>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
|
|
|
<collectionProp name="Asserion.test_strings">
|
|
|
<stringProp name="1450572480">"code":200</stringProp>
|
|
|
</collectionProp>
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<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>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
|
|
<name>throughput</name>
|
|
|
<value>60000</value>
|
|
|
<savedValue>0.0</savedValue>
|
|
|
</doubleProp>
|
|
|
<intProp name="calcMode">2</intProp>
|
|
|
</ConstantThroughputTimer>
|
|
|
<hashTree/>
|
|
|
</hashTree>
|
|
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_web_productModelTry_data" 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">80</stringProp>
|
|
|
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
|
|
|
<longProp name="ThreadGroup.start_time">1488865571000</longProp>
|
|
|
<longProp name="ThreadGroup.end_time">1488865571000</longProp>
|
|
|
<boolProp name="ThreadGroup.scheduler">false</boolProp>
|
|
|
<stringProp name="ThreadGroup.duration"></stringProp>
|
|
|
<stringProp name="ThreadGroup.delay"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">模特试穿</stringProp>
|
|
|
</ThreadGroup>
|
|
|
<hashTree>
|
|
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_web_productModelTry_data" enabled="true">
|
|
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
|
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
|
|
<collectionProp name="Arguments.arguments">
|
|
|
<elementProp name="" elementType="HTTPArgument">
|
|
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
|
|
<stringProp name="Argument.value"></stringProp>
|
|
|
<stringProp name="Argument.metadata">=</stringProp>
|
|
|
</elementProp>
|
|
|
</collectionProp>
|
|
|
</elementProp>
|
|
|
<stringProp name="HTTPSampler.domain"></stringProp>
|
|
|
<stringProp name="HTTPSampler.port"></stringProp>
|
|
|
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
|
|
|
<stringProp name="HTTPSampler.response_timeout"></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>
|
|
|
<boolProp name="HTTPSampler.monitor">false</boolProp>
|
|
|
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
|
|
|
<stringProp name="TestPlan.comments">模特试穿</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置BeanShell" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<boolProp name="resetInterpreter">false</boolProp>
|
|
|
<stringProp name="parameters">${product_skn}</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="script">import java.security.MessageDigest;
|
|
|
import java.util.Random;
|
|
|
String[] clientTypes = {"web"};
|
|
|
String[] privateKeys = {"0ed29744ed318fd28d2c07985d3ba633"};
|
|
|
int rd = new Random().nextInt(1);
|
|
|
String clientType = clientTypes[rd];
|
|
|
String privateKey = privateKeys[rd];
|
|
|
|
|
|
String req = "app_version=5.8.0&client_type="+clientType+"&method=web.productModelTry.data&os_version=yohobuy:web&private_key="+privateKey+"&product_skn="+bsh.args[0]+"&screen_size=720x1280&v=7";
|
|
|
String req = "app_version=5.8.0&client_type="+clientType+"&is_support_mlp=Y&method=app.Shopping.queryCart&os_version=yohobuy:web&private_key="+privateKey+"&screen_size=720x1280&session_key=3b3af315f8ee63ba511d596496dabd39&shopping_key="+bsh.args[0]+"&uid="+bsh.args[1]+"&v=7";
|
|
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
byte[] btInput = req.getBytes();
|
|
|
md.update(btInput);
|
...
|
...
|
|